Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: chrome/browser/chromeos/login/ui/login_display_host_impl.cc

Issue 620563002: ChromeOS NetworkScreenHandler should not call CheckAndResolveLocale on UI thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 const std::string first_screen_name; 192 const std::string first_screen_name;
193 const chromeos::StartupCustomizationDocument* const startup_manifest; 193 const chromeos::StartupCustomizationDocument* const startup_manifest;
194 chromeos::LoginDisplayHost* const display_host; 194 chromeos::LoginDisplayHost* const display_host;
195 195
196 // lock UI while resource bundle is being reloaded. 196 // lock UI while resource bundle is being reloaded.
197 chromeos::InputEventsBlocker events_blocker; 197 chromeos::InputEventsBlocker events_blocker;
198 }; 198 };
199 199
200 void OnLanguageSwitchedCallback( 200 void OnLanguageSwitchedCallback(
201 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> self, 201 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> self,
202 const std::string& locale, 202 const chromeos::locale_util::LanguageSwitchResult& result) {
203 const std::string& loaded_locale, 203 if (!result.success)
204 const bool success) { 204 LOG(WARNING) << "Locale could not be found for '" << result.requested_locale
205 if (!success) 205 << "'";
206 LOG(WARNING) << "Locale could not be found for '" << locale << "'";
207 206
208 ShowLoginWizardFinish( 207 ShowLoginWizardFinish(
209 self->first_screen_name, self->startup_manifest, self->display_host); 208 self->first_screen_name, self->startup_manifest, self->display_host);
210 } 209 }
211 210
212 void EnableSystemSoundsForAccessibility() { 211 void EnableSystemSoundsForAccessibility() {
213 chromeos::AccessibilityManager::Get()->EnableSystemSounds(true); 212 chromeos::AccessibilityManager::Get()->EnableSystemSounds(true);
214 } 213 }
215 214
216 // A login implementation of WidgetDelegate. 215 // A login implementation of WidgetDelegate.
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 // Chrome locale. Otherwise it will be lost if Chrome restarts. 1282 // Chrome locale. Otherwise it will be lost if Chrome restarts.
1284 // Don't need to schedule pref save because setting initial local 1283 // Don't need to schedule pref save because setting initial local
1285 // will enforce preference saving. 1284 // will enforce preference saving.
1286 prefs->SetString(prefs::kApplicationLocale, locale); 1285 prefs->SetString(prefs::kApplicationLocale, locale);
1287 StartupUtils::SetInitialLocale(locale); 1286 StartupUtils::SetInitialLocale(locale);
1288 1287
1289 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> data( 1288 scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> data(
1290 new ShowLoginWizardSwitchLanguageCallbackData( 1289 new ShowLoginWizardSwitchLanguageCallbackData(
1291 first_screen_name, startup_manifest, display_host)); 1290 first_screen_name, startup_manifest, display_host));
1292 1291
1293 scoped_ptr<locale_util::SwitchLanguageCallback> callback( 1292 locale_util::SwitchLanguageCallback callback(
1294 new locale_util::SwitchLanguageCallback( 1293 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())));
1295 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))));
1296 1294
1297 // Load locale keyboards here. Hardware layout would be automatically enabled. 1295 // Load locale keyboards here. Hardware layout would be automatically enabled.
1298 locale_util::SwitchLanguage( 1296 locale_util::SwitchLanguage(
1299 locale, true, true /* login_layouts_only */, callback.Pass()); 1297 locale, true, true /* login_layouts_only */, callback);
1300 } 1298 }
1301 1299
1302 } // namespace chromeos 1300 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698