Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/audio/sounds.h" | 9 #include "ash/audio/sounds.h" |
| 10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 // The delay of triggering initialization of the device policy subsystem | 117 // The delay of triggering initialization of the device policy subsystem |
| 118 // after the login screen is initialized. This makes sure that device policy | 118 // after the login screen is initialized. This makes sure that device policy |
| 119 // network requests are made while the system is idle waiting for user input. | 119 // network requests are made while the system is idle waiting for user input. |
| 120 const int64 kPolicyServiceInitializationDelayMilliseconds = 100; | 120 const int64 kPolicyServiceInitializationDelayMilliseconds = 100; |
| 121 | 121 |
| 122 // Determines the hardware keyboard from the given locale code | 122 // Determines the hardware keyboard from the given locale code |
| 123 // and the OEM layout information, and saves it to "Locale State". | 123 // and the OEM layout information, and saves it to "Locale State". |
| 124 // The information will be used in InputMethodUtil::GetHardwareInputMethodId(). | 124 // The information will be used in InputMethodUtil::GetHardwareInputMethodId(). |
| 125 void DetermineAndSaveHardwareKeyboard(const std::string& locale, | 125 void DetermineAndSaveHardwareKeyboard(const std::string& locale, |
| 126 const std::string& oem_layout) { | 126 const std::string& oem_layout) { |
| 127 LOG(ERROR) << oem_layout; | |
|
Alexander Alekseev
2014/02/11 13:36:02
Remove debug ?
Seigo Nonaka
2014/02/12 13:21:02
Oops, I'm sorry.
Removed.
On 2014/02/11 13:36:02,
| |
| 127 std::string layout; | 128 std::string layout; |
| 128 if (!oem_layout.empty()) { | 129 if (!oem_layout.empty()) { |
| 129 // If the OEM layout information is provided, use it. | 130 // If the OEM layout information is provided, use it. |
| 130 layout = oem_layout; | 131 layout = oem_layout; |
| 131 } else { | 132 } else { |
| 132 chromeos::input_method::InputMethodManager* manager = | 133 chromeos::input_method::InputMethodManager* manager = |
| 133 chromeos::input_method::InputMethodManager::Get(); | 134 chromeos::input_method::InputMethodManager::Get(); |
| 134 // Otherwise, determine the hardware keyboard from the locale. | 135 // Otherwise, determine the hardware keyboard from the locale. |
| 135 std::vector<std::string> input_method_ids; | 136 std::vector<std::string> input_method_ids; |
| 136 if (manager->GetInputMethodUtil()->GetInputMethodIdsFromLanguageCode( | 137 if (manager->GetInputMethodUtil()->GetInputMethodIdsFromLanguageCode( |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1132 | 1133 |
| 1133 if (show_login_screen) { | 1134 if (show_login_screen) { |
| 1134 // R11 > R12 migration fix. See http://crosbug.com/p/4898. | 1135 // R11 > R12 migration fix. See http://crosbug.com/p/4898. |
| 1135 // If user has manually changed locale during R11 OOBE, locale will be set. | 1136 // If user has manually changed locale during R11 OOBE, locale will be set. |
| 1136 // On R12 > R12|R13 etc. this fix won't get activated since | 1137 // On R12 > R12|R13 etc. this fix won't get activated since |
| 1137 // OOBE process has set kApplicationLocale to non-default value. | 1138 // OOBE process has set kApplicationLocale to non-default value. |
| 1138 PrefService* prefs = g_browser_process->local_state(); | 1139 PrefService* prefs = g_browser_process->local_state(); |
| 1139 if (!prefs->HasPrefPath(prefs::kApplicationLocale)) { | 1140 if (!prefs->HasPrefPath(prefs::kApplicationLocale)) { |
| 1140 std::string locale = chromeos::StartupUtils::GetInitialLocale(); | 1141 std::string locale = chromeos::StartupUtils::GetInitialLocale(); |
| 1141 prefs->SetString(prefs::kApplicationLocale, locale); | 1142 prefs->SetString(prefs::kApplicationLocale, locale); |
| 1142 manager->EnableLoginLayouts( | 1143 std::vector<std::string> hardware_layouts; |
| 1143 locale, manager->GetInputMethodUtil()->GetHardwareInputMethodId()); | 1144 manager->GetInputMethodUtil()->GetHardwareInputMethodIds( |
| 1145 &hardware_layouts); | |
| 1146 manager->EnableLoginLayouts(locale, hardware_layouts); | |
| 1144 base::ThreadRestrictions::ScopedAllowIO allow_io; | 1147 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 1145 const std::string loaded_locale = | 1148 const std::string loaded_locale = |
| 1146 ResourceBundle::GetSharedInstance().ReloadLocaleResources(locale); | 1149 ResourceBundle::GetSharedInstance().ReloadLocaleResources(locale); |
| 1147 g_browser_process->SetApplicationLocale(loaded_locale); | 1150 g_browser_process->SetApplicationLocale(loaded_locale); |
| 1148 } | 1151 } |
| 1149 display_host->StartSignInScreen(LoginScreenContext()); | 1152 display_host->StartSignInScreen(LoginScreenContext()); |
| 1150 return; | 1153 return; |
| 1151 } | 1154 } |
| 1152 | 1155 |
| 1153 // Load startup manifest. | 1156 // Load startup manifest. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1190 scoped_ptr<locale_util::SwitchLanguageCallback> callback( | 1193 scoped_ptr<locale_util::SwitchLanguageCallback> callback( |
| 1191 new locale_util::SwitchLanguageCallback( | 1194 new locale_util::SwitchLanguageCallback( |
| 1192 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); | 1195 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); |
| 1193 | 1196 |
| 1194 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1197 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1195 locale_util::SwitchLanguage( | 1198 locale_util::SwitchLanguage( |
| 1196 locale, true, true /* login_layouts_only */, callback.Pass()); | 1199 locale, true, true /* login_layouts_only */, callback.Pass()); |
| 1197 } | 1200 } |
| 1198 | 1201 |
| 1199 } // namespace chromeos | 1202 } // namespace chromeos |
| OLD | NEW |