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 <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/audio/sounds.h" | 10 #include "ash/audio/sounds.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 const std::string first_screen_name; | 199 const std::string first_screen_name; |
200 const chromeos::StartupCustomizationDocument* const startup_manifest; | 200 const chromeos::StartupCustomizationDocument* const startup_manifest; |
201 chromeos::LoginDisplayHost* const display_host; | 201 chromeos::LoginDisplayHost* const display_host; |
202 | 202 |
203 // lock UI while resource bundle is being reloaded. | 203 // lock UI while resource bundle is being reloaded. |
204 chromeos::InputEventsBlocker events_blocker; | 204 chromeos::InputEventsBlocker events_blocker; |
205 }; | 205 }; |
206 | 206 |
207 void OnLanguageSwitchedCallback( | 207 void OnLanguageSwitchedCallback( |
208 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> self, | 208 std::unique_ptr<ShowLoginWizardSwitchLanguageCallbackData> self, |
209 const chromeos::locale_util::LanguageSwitchResult& result) { | 209 const chromeos::locale_util::LanguageSwitchResult& result) { |
210 if (!result.success) | 210 if (!result.success) |
211 LOG(WARNING) << "Locale could not be found for '" << result.requested_locale | 211 LOG(WARNING) << "Locale could not be found for '" << result.requested_locale |
212 << "'"; | 212 << "'"; |
213 | 213 |
214 ShowLoginWizardFinish( | 214 ShowLoginWizardFinish( |
215 self->first_screen_name, self->startup_manifest, self->display_host); | 215 self->first_screen_name, self->startup_manifest, self->display_host); |
216 } | 216 } |
217 | 217 |
218 void EnableSystemSoundsForAccessibility() { | 218 void EnableSystemSoundsForAccessibility() { |
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 return; | 1251 return; |
1252 } | 1252 } |
1253 | 1253 |
1254 // Save initial locale from VPD/customization manifest as current | 1254 // Save initial locale from VPD/customization manifest as current |
1255 // Chrome locale. Otherwise it will be lost if Chrome restarts. | 1255 // Chrome locale. Otherwise it will be lost if Chrome restarts. |
1256 // Don't need to schedule pref save because setting initial local | 1256 // Don't need to schedule pref save because setting initial local |
1257 // will enforce preference saving. | 1257 // will enforce preference saving. |
1258 prefs->SetString(prefs::kApplicationLocale, locale); | 1258 prefs->SetString(prefs::kApplicationLocale, locale); |
1259 StartupUtils::SetInitialLocale(locale); | 1259 StartupUtils::SetInitialLocale(locale); |
1260 | 1260 |
1261 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> data( | 1261 std::unique_ptr<ShowLoginWizardSwitchLanguageCallbackData> data( |
1262 new ShowLoginWizardSwitchLanguageCallbackData( | 1262 new ShowLoginWizardSwitchLanguageCallbackData( |
1263 first_screen_name, startup_manifest, display_host)); | 1263 first_screen_name, startup_manifest, display_host)); |
1264 | 1264 |
1265 locale_util::SwitchLanguageCallback callback( | 1265 locale_util::SwitchLanguageCallback callback( |
1266 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); | 1266 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); |
1267 | 1267 |
1268 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1268 // Load locale keyboards here. Hardware layout would be automatically enabled. |
1269 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, | 1269 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, |
1270 callback, ProfileManager::GetActiveUserProfile()); | 1270 callback, ProfileManager::GetActiveUserProfile()); |
1271 } | 1271 } |
1272 | 1272 |
1273 } // namespace chromeos | 1273 } // namespace chromeos |
OLD | NEW |