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

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.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: Removed debug. 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/session/user_session_manager.h" 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 if (!chrome::IsRunningInForcedAppMode()) 367 if (!chrome::IsRunningInForcedAppMode())
368 return; 368 return;
369 369
370 chrome_client_id_ = chrome_client_id; 370 chrome_client_id_ = chrome_client_id;
371 chrome_client_secret_ = chrome_client_secret; 371 chrome_client_secret_ = chrome_client_secret;
372 } 372 }
373 373
374 bool UserSessionManager::RespectLocalePreference( 374 bool UserSessionManager::RespectLocalePreference(
375 Profile* profile, 375 Profile* profile,
376 const user_manager::User* user, 376 const user_manager::User* user,
377 scoped_ptr<locale_util::SwitchLanguageCallback> callback) const { 377 const locale_util::SwitchLanguageCallback& callback) const {
378 // TODO(alemate): http://crbug.com/288941 : Respect preferred language list in 378 // TODO(alemate): http://crbug.com/288941 : Respect preferred language list in
379 // the Google user profile. 379 // the Google user profile.
380 if (g_browser_process == NULL) 380 if (g_browser_process == NULL)
381 return false; 381 return false;
382 382
383 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); 383 user_manager::UserManager* user_manager = user_manager::UserManager::Get();
384 if (!user || (user_manager->IsUserLoggedIn() && 384 if (!user || (user_manager->IsUserLoggedIn() &&
385 user != user_manager->GetPrimaryUser())) { 385 user != user_manager->GetPrimaryUser())) {
386 return false; 386 return false;
387 } 387 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // are set up when the user first logs in. Then the user may customize the 435 // are set up when the user first logs in. Then the user may customize the
436 // input methods. Hence changing input methods here, just because the user's 436 // input methods. Hence changing input methods here, just because the user's
437 // UI language is different from the login screen UI language, is not 437 // UI language is different from the login screen UI language, is not
438 // desirable. Note that input method preferences are synced, so users can use 438 // desirable. Note that input method preferences are synced, so users can use
439 // their farovite input methods as soon as the preferences are synced. 439 // their farovite input methods as soon as the preferences are synced.
440 // 440 //
441 // For Guest mode, user locale preferences will never get initialized. 441 // For Guest mode, user locale preferences will never get initialized.
442 // So input methods should be enabled somewhere. 442 // So input methods should be enabled somewhere.
443 const bool enable_layouts = 443 const bool enable_layouts =
444 user_manager::UserManager::Get()->IsLoggedInAsGuest(); 444 user_manager::UserManager::Get()->IsLoggedInAsGuest();
445 locale_util::SwitchLanguage(pref_locale, 445 locale_util::SwitchLanguage(
446 enable_layouts, 446 pref_locale, enable_layouts, false /* login_layouts_only */, callback);
447 false /* login_layouts_only */,
448 callback.Pass());
449 447
450 return true; 448 return true;
451 } 449 }
452 450
453 bool UserSessionManager::NeedsToUpdateEasyUnlockKeys() const { 451 bool UserSessionManager::NeedsToUpdateEasyUnlockKeys() const {
454 return !CommandLine::ForCurrentProcess()->HasSwitch( 452 return !CommandLine::ForCurrentProcess()->HasSwitch(
455 chromeos::switches::kDisableEasySignin) && 453 chromeos::switches::kDisableEasySignin) &&
456 !user_context_.GetUserID().empty() && 454 !user_context_.GetUserID().empty() &&
457 user_context_.GetUserType() == user_manager::USER_TYPE_REGULAR && 455 user_context_.GetUserType() == user_manager::USER_TYPE_REGULAR &&
458 user_context_.GetKey() && !user_context_.GetKey()->GetSecret().empty(); 456 user_context_.GetKey() && !user_context_.GetKey()->GetSecret().empty();
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 return NULL; 1117 return NULL;
1120 } 1118 }
1121 1119
1122 if (!easy_unlock_key_manager_) 1120 if (!easy_unlock_key_manager_)
1123 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager); 1121 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager);
1124 1122
1125 return easy_unlock_key_manager_.get(); 1123 return easy_unlock_key_manager_.get();
1126 } 1124 }
1127 1125
1128 } // namespace chromeos 1126 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698