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