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

Side by Side Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 133273032: Guest Mode: input method should default to the underlying latin keyboard layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Use EnableInputMethod instead of EnableInputMethods. Created 6 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/user_manager_impl.h" 5 #include "chrome/browser/chromeos/login/user_manager_impl.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 DCHECK(!pref_locale.empty()); 832 DCHECK(!pref_locale.empty());
833 LOG(WARNING) << "RespectLocalePreference: " 833 LOG(WARNING) << "RespectLocalePreference: "
834 << "app_locale='" << pref_app_locale << "', " 834 << "app_locale='" << pref_app_locale << "', "
835 << "bkup_locale='" << pref_bkup_locale << "', " 835 << "bkup_locale='" << pref_bkup_locale << "', "
836 << (account_locale != NULL 836 << (account_locale != NULL
837 ? (std::string("account_locale='") + (*account_locale) + 837 ? (std::string("account_locale='") + (*account_locale) +
838 "'. ") 838 "'. ")
839 : (std::string("account_locale - unused. "))) 839 : (std::string("account_locale - unused. ")))
840 << " Selected '" << pref_locale << "'"; 840 << " Selected '" << pref_locale << "'";
841 profile->ChangeAppLocale(pref_locale, Profile::APP_LOCALE_CHANGED_VIA_LOGIN); 841 profile->ChangeAppLocale(pref_locale, Profile::APP_LOCALE_CHANGED_VIA_LOGIN);
842 // Here we don't enable keyboard layouts. Input methods are set up when 842
843 // the user first logs in. Then the user may customize the input methods. 843 // Here we don't enable keyboard layouts for normal users. Input methods
844 // Hence changing input methods here, just because the user's UI language 844 // are set up when the user first logs in. Then the user may customize the
845 // is different from the login screen UI language, is not desirable. Note 845 // input methods. Hence changing input methods here, just because the user's
846 // that input method preferences are synced, so users can use their 846 // UI language is different from the login screen UI language, is not
847 // farovite input methods as soon as the preferences are synced. 847 // desirable. Note that input method preferences are synced, so users can use
848 locale_util::SwitchLanguage(pref_locale, false, callback.Pass()); 848 // their farovite input methods as soon as the preferences are synced.
849 //
850 // For Guest mode, user locale preferences will never get initialized.
851 // So input methods should be enabled somewhere.
852 const bool enable_layouts = UserManager::Get()->IsLoggedInAsGuest();
853 locale_util::SwitchLanguage(pref_locale,
854 enable_layouts,
855 false /* login_layouts_only */,
856 callback.Pass());
849 857
850 return true; 858 return true;
851 } 859 }
852 860
853 void UserManagerImpl::StopPolicyObserverForTesting() { 861 void UserManagerImpl::StopPolicyObserverForTesting() {
854 policy_observer_.reset(); 862 policy_observer_.reset();
855 } 863 }
856 864
857 void UserManagerImpl::Observe(int type, 865 void UserManagerImpl::Observe(int type,
858 const content::NotificationSource& source, 866 const content::NotificationSource& source,
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1957 if (User* user = FindUserAndModify(user_id)) 1965 if (User* user = FindUserAndModify(user_id))
1958 user->SetAccountLocale(resolved_locale); 1966 user->SetAccountLocale(resolved_locale);
1959 } 1967 }
1960 1968
1961 void UserManagerImpl::UpdateNumberOfUsers() { 1969 void UserManagerImpl::UpdateNumberOfUsers() {
1962 base::debug::SetCrashKeyValue(crash_keys::kNumberOfUsers, 1970 base::debug::SetCrashKeyValue(crash_keys::kNumberOfUsers,
1963 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); 1971 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size()));
1964 } 1972 }
1965 1973
1966 } // namespace chromeos 1974 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698