Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2235)

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 23095006: If user profile doesn't contain language setting, default to his Google account settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment on "list of preferred languages". Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index c3650e8ba514879259e8d40b907acc558da8e9aa..720a4007425132e0205c1aee10d3721e5247b43b 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
+#include "base/debug/stack_trace.h"
sail 2013/09/09 22:02:17 don't need?
#include "base/debug/trace_event.h"
#include "base/environment.h"
#include "base/file_util.h"
@@ -29,6 +30,7 @@
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/chromeos/login/language_switch_menu.h"
sail 2013/09/09 22:02:17 don't need?
#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/download/chrome_download_manager_delegate.h"
@@ -1042,7 +1044,9 @@ void ProfileImpl::ChangeAppLocale(
// (2) on next login we assume that synchronization is already completed
// and we may finalize initialization.
GetPrefs()->SetString(prefs::kApplicationLocaleBackup, cur_locale);
- if (!backup_locale.empty())
+ if (!new_locale.empty())
+ GetPrefs()->SetString(prefs::kApplicationLocale, new_locale);
+ else if (!backup_locale.empty())
GetPrefs()->SetString(prefs::kApplicationLocale, backup_locale);
do_update_pref = false;
}

Powered by Google App Engine
This is Rietveld 408576698