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

Unified Diff: chrome/browser/chromeos/login/login_utils.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/chromeos/login/login_utils.cc
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index f3c8e3e6957706851155cf01e63cbc32de8d1a74..7b4cca0a7b394389a84401b2d106fac67613a1d8 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -35,7 +35,6 @@
#include "chrome/browser/chromeos/boot_times_loader.h"
#include "chrome/browser/chromeos/input_method/input_method_util.h"
#include "chrome/browser/chromeos/login/chrome_restart_request.h"
-#include "chrome/browser/chromeos/login/language_switch_menu.h"
#include "chrome/browser/chromeos/login/login_display_host.h"
#include "chrome/browser/chromeos/login/oauth_login_manager.h"
#include "chrome/browser/chromeos/login/parallel_authenticator.h"
@@ -147,9 +146,6 @@ class LoginUtilsImpl
// Restarts OAuth session authentication check.
void KickStartAuthentication(Profile* profile);
- // Check user's profile for kApplicationLocale setting.
- void RespectLocalePreference(Profile* pref);
-
// Callback for Profile::CREATE_STATUS_CREATED profile state.
// Initializes basic preferences for newly created profile. Any other
// early profile initialization that needs to happen before
@@ -360,8 +356,6 @@ void LoginUtilsImpl::InitProfilePreferences(Profile* user_profile) {
google_services_username.SetValue(
UserManager::Get()->GetLoggedInUser()->display_email());
}
-
- RespectLocalePreference(user_profile);
}
void LoginUtilsImpl::InitSessionRestoreStrategy() {
@@ -410,12 +404,12 @@ void LoginUtilsImpl::OnProfileCreated(
CHECK(user_profile);
switch (status) {
- case Profile::CREATE_STATUS_INITIALIZED:
- UserProfileInitialized(user_profile);
- break;
case Profile::CREATE_STATUS_CREATED:
InitProfilePreferences(user_profile);
break;
+ case Profile::CREATE_STATUS_INITIALIZED:
+ UserProfileInitialized(user_profile);
+ break;
case Profile::CREATE_STATUS_LOCAL_FAIL:
case Profile::CREATE_STATUS_REMOTE_FAIL:
case Profile::CREATE_STATUS_CANCELED:
@@ -594,29 +588,6 @@ void LoginUtilsImpl::StartSignedInServices(Profile* user_profile) {
user_context_.auth_code.clear();
}
-void LoginUtilsImpl::RespectLocalePreference(Profile* profile) {
- DCHECK(profile != NULL);
- PrefService* prefs = profile->GetPrefs();
- DCHECK(prefs != NULL);
- if (g_browser_process == NULL)
- return;
-
- std::string pref_locale = prefs->GetString(prefs::kApplicationLocale);
- if (pref_locale.empty())
- pref_locale = prefs->GetString(prefs::kApplicationLocaleBackup);
- if (pref_locale.empty())
- pref_locale = g_browser_process->GetApplicationLocale();
- DCHECK(!pref_locale.empty());
- profile->ChangeAppLocale(pref_locale, Profile::APP_LOCALE_CHANGED_VIA_LOGIN);
- // Here we don't enable keyboard layouts. Input methods are set up when
- // the user first logs in. Then the user may customize the input methods.
- // Hence changing input methods here, just because the user's UI language
- // is different from the login screen UI language, is not desirable. Note
- // that input method preferences are synced, so users can use their
- // farovite input methods as soon as the preferences are synced.
- LanguageSwitchMenu::SwitchLanguage(pref_locale);
-}
-
void LoginUtilsImpl::CompleteOffTheRecordLogin(const GURL& start_url) {
VLOG(1) << "Completing incognito login";
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/mock_user_manager.h » ('j') | chrome/browser/chromeos/login/user.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698