| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 const std::string first_screen_name; | 193 const std::string first_screen_name; |
| 194 const chromeos::StartupCustomizationDocument* const startup_manifest; | 194 const chromeos::StartupCustomizationDocument* const startup_manifest; |
| 195 chromeos::LoginDisplayHost* const display_host; | 195 chromeos::LoginDisplayHost* const display_host; |
| 196 | 196 |
| 197 // lock UI while resource bundle is being reloaded. | 197 // lock UI while resource bundle is being reloaded. |
| 198 chromeos::InputEventsBlocker events_blocker; | 198 chromeos::InputEventsBlocker events_blocker; |
| 199 }; | 199 }; |
| 200 | 200 |
| 201 void OnLanguageSwitchedCallback( | 201 void OnLanguageSwitchedCallback( |
| 202 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> self, | 202 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> self, |
| 203 const chromeos::locale_util::LanguageSwitchResult& result) { | 203 const std::string& locale, |
| 204 if (!result.success) | 204 const std::string& loaded_locale, |
| 205 LOG(WARNING) << "Locale could not be found for '" << result.requested_locale | 205 const bool success) { |
| 206 << "'"; | 206 if (!success) |
| 207 LOG(WARNING) << "Locale could not be found for '" << locale << "'"; |
| 207 | 208 |
| 208 ShowLoginWizardFinish( | 209 ShowLoginWizardFinish( |
| 209 self->first_screen_name, self->startup_manifest, self->display_host); | 210 self->first_screen_name, self->startup_manifest, self->display_host); |
| 210 } | 211 } |
| 211 | 212 |
| 212 void EnableSystemSoundsForAccessibility() { | 213 void EnableSystemSoundsForAccessibility() { |
| 213 chromeos::AccessibilityManager::Get()->EnableSystemSounds(true); | 214 chromeos::AccessibilityManager::Get()->EnableSystemSounds(true); |
| 214 } | 215 } |
| 215 | 216 |
| 216 // A login implementation of WidgetDelegate. | 217 // A login implementation of WidgetDelegate. |
| (...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 // Chrome locale. Otherwise it will be lost if Chrome restarts. | 1286 // Chrome locale. Otherwise it will be lost if Chrome restarts. |
| 1286 // Don't need to schedule pref save because setting initial local | 1287 // Don't need to schedule pref save because setting initial local |
| 1287 // will enforce preference saving. | 1288 // will enforce preference saving. |
| 1288 prefs->SetString(prefs::kApplicationLocale, locale); | 1289 prefs->SetString(prefs::kApplicationLocale, locale); |
| 1289 StartupUtils::SetInitialLocale(locale); | 1290 StartupUtils::SetInitialLocale(locale); |
| 1290 | 1291 |
| 1291 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> data( | 1292 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> data( |
| 1292 new ShowLoginWizardSwitchLanguageCallbackData( | 1293 new ShowLoginWizardSwitchLanguageCallbackData( |
| 1293 first_screen_name, startup_manifest, display_host)); | 1294 first_screen_name, startup_manifest, display_host)); |
| 1294 | 1295 |
| 1295 locale_util::SwitchLanguageCallback callback( | 1296 scoped_ptr<locale_util::SwitchLanguageCallback> callback( |
| 1296 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); | 1297 new locale_util::SwitchLanguageCallback( |
| 1298 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); |
| 1297 | 1299 |
| 1298 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1300 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1299 locale_util::SwitchLanguage( | 1301 locale_util::SwitchLanguage( |
| 1300 locale, true, true /* login_layouts_only */, callback); | 1302 locale, true, true /* login_layouts_only */, callback.Pass()); |
| 1301 } | 1303 } |
| 1302 | 1304 |
| 1303 } // namespace chromeos | 1305 } // namespace chromeos |
| OLD | NEW |