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

Side by Side Diff: chrome/browser/chromeos/login/login_utils.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: Cleanup. 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/login_utils.h" 5 #include "chrome/browser/chromeos/login/login_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 #endif 208 #endif
209 209
210 private: 210 private:
211 void DoBrowserLaunchInternal(Profile* profile, 211 void DoBrowserLaunchInternal(Profile* profile,
212 LoginDisplayHost* login_host, 212 LoginDisplayHost* login_host,
213 bool locale_pref_checked); 213 bool locale_pref_checked);
214 214
215 static void RunCallbackOnLocaleLoaded( 215 static void RunCallbackOnLocaleLoaded(
216 const base::Closure& callback, 216 const base::Closure& callback,
217 InputEventsBlocker* input_events_blocker, 217 InputEventsBlocker* input_events_blocker,
218 const std::string& locale, 218 scoped_ptr<locale_util::LanguageSwitchResult> result);
219 const std::string& loaded_locale,
220 const bool success);
221 219
222 // Attempts restarting the browser process and esures that this does 220 // Attempts restarting the browser process and esures that this does
223 // not happen while we are still fetching new OAuth refresh tokens. 221 // not happen while we are still fetching new OAuth refresh tokens.
224 void AttemptRestart(Profile* profile); 222 void AttemptRestart(Profile* profile);
225 223
226 // Has to be scoped_refptr, see comment for CreateAuthenticator(...). 224 // Has to be scoped_refptr, see comment for CreateAuthenticator(...).
227 scoped_refptr<Authenticator> authenticator_; 225 scoped_refptr<Authenticator> authenticator_;
228 226
229 // Delegate to be fired when the profile will be prepared. 227 // Delegate to be fired when the profile will be prepared.
230 LoginUtils::Delegate* delegate_; 228 LoginUtils::Delegate* delegate_;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 login_host->Finalize(); 319 login_host->Finalize();
322 user_manager::UserManager::Get()->SessionStarted(); 320 user_manager::UserManager::Get()->SessionStarted();
323 chromeos::BootTimesLoader::Get()->LoginDone( 321 chromeos::BootTimesLoader::Get()->LoginDone(
324 user_manager::UserManager::Get()->IsCurrentUserNew()); 322 user_manager::UserManager::Get()->IsCurrentUserNew());
325 } 323 }
326 324
327 // static 325 // static
328 void LoginUtilsImpl::RunCallbackOnLocaleLoaded( 326 void LoginUtilsImpl::RunCallbackOnLocaleLoaded(
329 const base::Closure& callback, 327 const base::Closure& callback,
330 InputEventsBlocker* /* input_events_blocker */, 328 InputEventsBlocker* /* input_events_blocker */,
331 const std::string& /* locale */, 329 scoped_ptr<locale_util::LanguageSwitchResult> /* result */) {
332 const std::string& /* loaded_locale */,
333 const bool /* success */) {
334 callback.Run(); 330 callback.Run();
335 } 331 }
336 332
337 void LoginUtilsImpl::RespectLocalePreference(Profile* profile, 333 void LoginUtilsImpl::RespectLocalePreference(Profile* profile,
338 const base::Closure& callback) { 334 const base::Closure& callback) {
339 if (browser_shutdown::IsTryingToQuit()) 335 if (browser_shutdown::IsTryingToQuit())
340 return; 336 return;
341 337
342 user_manager::User* const user = 338 user_manager::User* const user =
343 ProfileHelper::Get()->GetUserByProfile(profile); 339 ProfileHelper::Get()->GetUserByProfile(profile);
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 CrosSettings* cros_settings = CrosSettings::Get(); 505 CrosSettings* cros_settings = CrosSettings::Get();
510 bool allow_new_user = false; 506 bool allow_new_user = false;
511 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 507 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
512 if (allow_new_user) 508 if (allow_new_user)
513 return true; 509 return true;
514 return cros_settings->FindEmailInList( 510 return cros_settings->FindEmailInList(
515 kAccountsPrefUsers, username, wildcard_match); 511 kAccountsPrefUsers, username, wildcard_match);
516 } 512 }
517 513
518 } // namespace chromeos 514 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698