OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/ui/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 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 return; | 1161 return; |
1162 | 1162 |
1163 VLOG(1) << "Showing OOBE screen: " << first_screen_name; | 1163 VLOG(1) << "Showing OOBE screen: " << first_screen_name; |
1164 | 1164 |
1165 chromeos::input_method::InputMethodManager* manager = | 1165 chromeos::input_method::InputMethodManager* manager = |
1166 chromeos::input_method::InputMethodManager::Get(); | 1166 chromeos::input_method::InputMethodManager::Get(); |
1167 | 1167 |
1168 // Set up keyboards. For example, when |locale| is "en-US", enable US qwerty | 1168 // Set up keyboards. For example, when |locale| is "en-US", enable US qwerty |
1169 // and US dvorak keyboard layouts. | 1169 // and US dvorak keyboard layouts. |
1170 if (g_browser_process && g_browser_process->local_state()) { | 1170 if (g_browser_process && g_browser_process->local_state()) { |
1171 manager->SetInputMethodLoginDefault(); | 1171 manager->GetActiveIMEState()->SetInputMethodLoginDefault(); |
1172 | 1172 |
1173 PrefService* prefs = g_browser_process->local_state(); | 1173 PrefService* prefs = g_browser_process->local_state(); |
1174 // Apply owner preferences for tap-to-click and mouse buttons swap for | 1174 // Apply owner preferences for tap-to-click and mouse buttons swap for |
1175 // login screen. | 1175 // login screen. |
1176 system::InputDeviceSettings::Get()->SetPrimaryButtonRight( | 1176 system::InputDeviceSettings::Get()->SetPrimaryButtonRight( |
1177 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight)); | 1177 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight)); |
1178 system::InputDeviceSettings::Get()->SetTapToClick( | 1178 system::InputDeviceSettings::Get()->SetTapToClick( |
1179 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); | 1179 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); |
1180 } | 1180 } |
1181 system::InputDeviceSettings::Get()->SetNaturalScroll( | 1181 system::InputDeviceSettings::Get()->SetNaturalScroll( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 const std::string& current_locale = | 1246 const std::string& current_locale = |
1247 prefs->GetString(prefs::kApplicationLocale); | 1247 prefs->GetString(prefs::kApplicationLocale); |
1248 VLOG(1) << "Current locale: " << current_locale; | 1248 VLOG(1) << "Current locale: " << current_locale; |
1249 const std::string& locale = startup_manifest->initial_locale_default(); | 1249 const std::string& locale = startup_manifest->initial_locale_default(); |
1250 | 1250 |
1251 const std::string& layout = startup_manifest->keyboard_layout(); | 1251 const std::string& layout = startup_manifest->keyboard_layout(); |
1252 VLOG(1) << "Initial locale: " << locale << "keyboard layout " << layout; | 1252 VLOG(1) << "Initial locale: " << locale << "keyboard layout " << layout; |
1253 | 1253 |
1254 // Determine keyboard layout from OEM customization (if provided) or | 1254 // Determine keyboard layout from OEM customization (if provided) or |
1255 // initial locale and save it in preferences. | 1255 // initial locale and save it in preferences. |
1256 manager->SetInputMethodLoginDefaultFromVPD(locale, layout); | 1256 manager->GetActiveIMEState()->SetInputMethodLoginDefaultFromVPD(locale, |
| 1257 layout); |
1257 | 1258 |
1258 if (!current_locale.empty() || locale.empty()) { | 1259 if (!current_locale.empty() || locale.empty()) { |
1259 ShowLoginWizardFinish(first_screen_name, startup_manifest, display_host); | 1260 ShowLoginWizardFinish(first_screen_name, startup_manifest, display_host); |
1260 return; | 1261 return; |
1261 } | 1262 } |
1262 | 1263 |
1263 // Save initial locale from VPD/customization manifest as current | 1264 // Save initial locale from VPD/customization manifest as current |
1264 // Chrome locale. Otherwise it will be lost if Chrome restarts. | 1265 // Chrome locale. Otherwise it will be lost if Chrome restarts. |
1265 // Don't need to schedule pref save because setting initial local | 1266 // Don't need to schedule pref save because setting initial local |
1266 // will enforce preference saving. | 1267 // will enforce preference saving. |
1267 prefs->SetString(prefs::kApplicationLocale, locale); | 1268 prefs->SetString(prefs::kApplicationLocale, locale); |
1268 StartupUtils::SetInitialLocale(locale); | 1269 StartupUtils::SetInitialLocale(locale); |
1269 | 1270 |
1270 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> data( | 1271 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> data( |
1271 new ShowLoginWizardSwitchLanguageCallbackData( | 1272 new ShowLoginWizardSwitchLanguageCallbackData( |
1272 first_screen_name, startup_manifest, display_host)); | 1273 first_screen_name, startup_manifest, display_host)); |
1273 | 1274 |
1274 scoped_ptr<locale_util::SwitchLanguageCallback> callback( | 1275 scoped_ptr<locale_util::SwitchLanguageCallback> callback( |
1275 new locale_util::SwitchLanguageCallback( | 1276 new locale_util::SwitchLanguageCallback( |
1276 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); | 1277 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); |
1277 | 1278 |
1278 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1279 // Load locale keyboards here. Hardware layout would be automatically enabled. |
1279 locale_util::SwitchLanguage( | 1280 locale_util::SwitchLanguage( |
1280 locale, true, true /* login_layouts_only */, callback.Pass()); | 1281 locale, true, true /* login_layouts_only */, callback.Pass()); |
1281 } | 1282 } |
1282 | 1283 |
1283 } // namespace chromeos | 1284 } // namespace chromeos |
OLD | NEW |