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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 return; | 1143 return; |
1144 | 1144 |
1145 VLOG(1) << "Showing OOBE screen: " << first_screen_name; | 1145 VLOG(1) << "Showing OOBE screen: " << first_screen_name; |
1146 | 1146 |
1147 chromeos::input_method::InputMethodManager* manager = | 1147 chromeos::input_method::InputMethodManager* manager = |
1148 chromeos::input_method::InputMethodManager::Get(); | 1148 chromeos::input_method::InputMethodManager::Get(); |
1149 | 1149 |
1150 // Set up keyboards. For example, when |locale| is "en-US", enable US qwerty | 1150 // Set up keyboards. For example, when |locale| is "en-US", enable US qwerty |
1151 // and US dvorak keyboard layouts. | 1151 // and US dvorak keyboard layouts. |
1152 if (g_browser_process && g_browser_process->local_state()) { | 1152 if (g_browser_process && g_browser_process->local_state()) { |
1153 manager->SetInputMethodLoginDefault(); | 1153 manager->GetActiveIMEState()->SetInputMethodLoginDefault(); |
1154 | 1154 |
1155 PrefService* prefs = g_browser_process->local_state(); | 1155 PrefService* prefs = g_browser_process->local_state(); |
1156 // Apply owner preferences for tap-to-click and mouse buttons swap for | 1156 // Apply owner preferences for tap-to-click and mouse buttons swap for |
1157 // login screen. | 1157 // login screen. |
1158 system::InputDeviceSettings::Get()->SetPrimaryButtonRight( | 1158 system::InputDeviceSettings::Get()->SetPrimaryButtonRight( |
1159 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight)); | 1159 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight)); |
1160 system::InputDeviceSettings::Get()->SetTapToClick( | 1160 system::InputDeviceSettings::Get()->SetTapToClick( |
1161 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); | 1161 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); |
1162 } | 1162 } |
1163 system::InputDeviceSettings::Get()->SetNaturalScroll( | 1163 system::InputDeviceSettings::Get()->SetNaturalScroll( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 const std::string& current_locale = | 1228 const std::string& current_locale = |
1229 prefs->GetString(prefs::kApplicationLocale); | 1229 prefs->GetString(prefs::kApplicationLocale); |
1230 VLOG(1) << "Current locale: " << current_locale; | 1230 VLOG(1) << "Current locale: " << current_locale; |
1231 const std::string& locale = startup_manifest->initial_locale_default(); | 1231 const std::string& locale = startup_manifest->initial_locale_default(); |
1232 | 1232 |
1233 const std::string& layout = startup_manifest->keyboard_layout(); | 1233 const std::string& layout = startup_manifest->keyboard_layout(); |
1234 VLOG(1) << "Initial locale: " << locale << "keyboard layout " << layout; | 1234 VLOG(1) << "Initial locale: " << locale << "keyboard layout " << layout; |
1235 | 1235 |
1236 // Determine keyboard layout from OEM customization (if provided) or | 1236 // Determine keyboard layout from OEM customization (if provided) or |
1237 // initial locale and save it in preferences. | 1237 // initial locale and save it in preferences. |
1238 manager->SetInputMethodLoginDefaultFromVPD(locale, layout); | 1238 manager->GetActiveIMEState()->SetInputMethodLoginDefaultFromVPD(locale, |
| 1239 layout); |
1239 | 1240 |
1240 if (!current_locale.empty() || locale.empty()) { | 1241 if (!current_locale.empty() || locale.empty()) { |
1241 ShowLoginWizardFinish(first_screen_name, startup_manifest, display_host); | 1242 ShowLoginWizardFinish(first_screen_name, startup_manifest, display_host); |
1242 return; | 1243 return; |
1243 } | 1244 } |
1244 | 1245 |
1245 // Save initial locale from VPD/customization manifest as current | 1246 // Save initial locale from VPD/customization manifest as current |
1246 // Chrome locale. Otherwise it will be lost if Chrome restarts. | 1247 // Chrome locale. Otherwise it will be lost if Chrome restarts. |
1247 // Don't need to schedule pref save because setting initial local | 1248 // Don't need to schedule pref save because setting initial local |
1248 // will enforce preference saving. | 1249 // will enforce preference saving. |
1249 prefs->SetString(prefs::kApplicationLocale, locale); | 1250 prefs->SetString(prefs::kApplicationLocale, locale); |
1250 StartupUtils::SetInitialLocale(locale); | 1251 StartupUtils::SetInitialLocale(locale); |
1251 | 1252 |
1252 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> data( | 1253 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> data( |
1253 new ShowLoginWizardSwitchLanguageCallbackData( | 1254 new ShowLoginWizardSwitchLanguageCallbackData( |
1254 first_screen_name, startup_manifest, display_host)); | 1255 first_screen_name, startup_manifest, display_host)); |
1255 | 1256 |
1256 scoped_ptr<locale_util::SwitchLanguageCallback> callback( | 1257 scoped_ptr<locale_util::SwitchLanguageCallback> callback( |
1257 new locale_util::SwitchLanguageCallback( | 1258 new locale_util::SwitchLanguageCallback( |
1258 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); | 1259 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); |
1259 | 1260 |
1260 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1261 // Load locale keyboards here. Hardware layout would be automatically enabled. |
1261 locale_util::SwitchLanguage( | 1262 locale_util::SwitchLanguage( |
1262 locale, true, true /* login_layouts_only */, callback.Pass()); | 1263 locale, true, true /* login_layouts_only */, callback.Pass()); |
1263 } | 1264 } |
1264 | 1265 |
1265 } // namespace chromeos | 1266 } // namespace chromeos |
OLD | NEW |