Index: chrome/browser/chromeos/input_method/input_method_persistence.cc |
diff --git a/chrome/browser/chromeos/input_method/input_method_persistence.cc b/chrome/browser/chromeos/input_method/input_method_persistence.cc |
index a139b92a39f3a7841b1df33568f160499ac5b684..b5d648396f13ec37e4f51b3753a495b69a547290 100644 |
--- a/chrome/browser/chromeos/input_method/input_method_persistence.cc |
+++ b/chrome/browser/chromeos/input_method/input_method_persistence.cc |
@@ -27,10 +27,24 @@ |
language_prefs::kPreferredKeyboardLayout, input_method); |
} |
-static void SetUserLRUInputMethodPreference(const std::string& username, |
- const std::string& input_method, |
- PrefService* local_state) { |
- if (!username.empty() && !local_state->ReadOnly()) { |
+// Update user LRU keyboard layout for login screen |
+static void SetUserLRUInputMethod( |
+ const std::string& input_method, |
+ const chromeos::input_method::InputMethodManager* const manager, |
+ Profile* profile) { |
+ // Skip if it's not a keyboard layout. Drop input methods including |
+ // extension ones. |
+ if (!manager->IsLoginKeyboard(input_method)) |
+ return; |
+ |
+ PrefService* const local_state = g_browser_process->local_state(); |
+ |
+ if (profile == NULL) |
+ return; |
+ |
+ const std::string username = profile->GetProfileName(); |
+ if (base::SysInfo::IsRunningOnChromeOS() && !username.empty() && |
+ !local_state->ReadOnly()) { |
bool update_succeed = false; |
{ |
// Updater may have side-effects, therefore we do not replace |
@@ -61,25 +75,6 @@ |
<< prefs::kUsersLRUInputMethod << "' for '" << username << "'"; |
} |
} |
-} |
- |
-// Update user LRU keyboard layout for login screen |
-static void SetUserLRUInputMethod( |
- const std::string& input_method, |
- const chromeos::input_method::InputMethodManager* const manager, |
- Profile* profile) { |
- // Skip if it's not a keyboard layout. Drop input methods including |
- // extension ones. |
- if (!manager->IsLoginKeyboard(input_method)) |
- return; |
- |
- if (profile == NULL) |
- return; |
- |
- PrefService* const local_state = g_browser_process->local_state(); |
- |
- SetUserLRUInputMethodPreference( |
- profile->GetProfileName(), input_method, local_state); |
} |
void PersistUserInputMethod(const std::string& input_method, |
@@ -151,11 +146,5 @@ |
ui_session_ = new_ui_session; |
} |
-void SetUserLRUInputMethodPreferenceForTesting(const std::string& username, |
- const std::string& input_method, |
- PrefService* const local_state) { |
- SetUserLRUInputMethodPreference(username, input_method, local_state); |
-} |
- |
} // namespace input_method |
} // namespace chromeos |