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

Side by Side Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 23531054: Don't switch browser locale on secondary user login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: previous upload failed Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <vector> 8 #include <vector>
9 9
10 #include "base/chromeos/chromeos_version.h" 10 #include "base/chromeos/chromeos_version.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // Make sure that the google service username is properly set (we do this 371 // Make sure that the google service username is properly set (we do this
372 // on every sign in, not just the first login, to deal with existing 372 // on every sign in, not just the first login, to deal with existing
373 // profiles that might not have it set yet). 373 // profiles that might not have it set yet).
374 StringPrefMember google_services_username; 374 StringPrefMember google_services_username;
375 google_services_username.Init(prefs::kGoogleServicesUsername, 375 google_services_username.Init(prefs::kGoogleServicesUsername,
376 user_profile->GetPrefs()); 376 user_profile->GetPrefs());
377 const User* user = UserManager::Get()->FindUser(email); 377 const User* user = UserManager::Get()->FindUser(email);
378 google_services_username.SetValue(user ? user->display_email() : email); 378 google_services_username.SetValue(user ? user->display_email() : email);
379 } 379 }
380 380
381 RespectLocalePreference(user_profile); 381 // For multi-profile case don't apply profile local because it is not safe.
382 if (UserManager::Get()->GetLoggedInUsers().size() == 1)
Mr4D (OOO till 08-26) 2013/09/13 23:41:36 Don't know how this plays into it, but while debug
Dmitry Polukhin 2013/09/14 00:28:16 Good catch! It is place where we can switch input
383 RespectLocalePreference(user_profile);
382 } 384 }
383 385
384 void LoginUtilsImpl::InitSessionRestoreStrategy() { 386 void LoginUtilsImpl::InitSessionRestoreStrategy() {
385 CommandLine* command_line = CommandLine::ForCurrentProcess(); 387 CommandLine* command_line = CommandLine::ForCurrentProcess();
386 bool in_app_mode = chrome::IsRunningInForcedAppMode(); 388 bool in_app_mode = chrome::IsRunningInForcedAppMode();
387 389
388 // Are we in kiosk app mode? 390 // Are we in kiosk app mode?
389 if (in_app_mode) { 391 if (in_app_mode) {
390 if (command_line->HasSwitch(::switches::kAppModeOAuth2Token)) { 392 if (command_line->HasSwitch(::switches::kAppModeOAuth2Token)) {
391 oauth2_refresh_token_ = command_line->GetSwitchValueASCII( 393 oauth2_refresh_token_ = command_line->GetSwitchValueASCII(
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 bool LoginUtils::IsWhitelisted(const std::string& username) { 806 bool LoginUtils::IsWhitelisted(const std::string& username) {
805 CrosSettings* cros_settings = CrosSettings::Get(); 807 CrosSettings* cros_settings = CrosSettings::Get();
806 bool allow_new_user = false; 808 bool allow_new_user = false;
807 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 809 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
808 if (allow_new_user) 810 if (allow_new_user)
809 return true; 811 return true;
810 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); 812 return cros_settings->FindEmailInList(kAccountsPrefUsers, username);
811 } 813 }
812 814
813 } // namespace chromeos 815 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698