OLD | NEW |
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 Loading... |
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) |
| 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 Loading... |
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 |
OLD | NEW |