Use application locale for renderer preferences in Incognito

This fixes a discrepancy between navigator.languages and
Accept-Languages in Incognito.

Bug: 1077547
Change-Id: Iefc8192f1f9a6d9bfe3c65faf26a29b8edf03b53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2370123
Commit-Queue: Megan Jablonski <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#801987}
diff --git a/chrome/browser/renderer_preferences_util.cc b/chrome/browser/renderer_preferences_util.cc
index 0acace5..71fdef9 100644
--- a/chrome/browser/renderer_preferences_util.cc
+++ b/chrome/browser/renderer_preferences_util.cc
@@ -96,8 +96,12 @@
 void UpdateFromSystemSettings(blink::mojom::RendererPreferences* prefs,
                               Profile* profile) {
   const PrefService* pref_service = profile->GetPrefs();
-  prefs->accept_languages =
-      pref_service->GetString(language::prefs::kAcceptLanguages);
+  if (profile->IsOffTheRecord()) {
+    prefs->accept_languages = g_browser_process->GetApplicationLocale();
+  } else {
+    prefs->accept_languages =
+        pref_service->GetString(language::prefs::kAcceptLanguages);
+  }
   prefs->enable_referrers = pref_service->GetBoolean(prefs::kEnableReferrers);
   prefs->enable_do_not_track =
       pref_service->GetBoolean(prefs::kEnableDoNotTrack);