| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 // Make sure that the google service username is properly set (we do this | 358 // Make sure that the google service username is properly set (we do this |
| 359 // on every sign in, not just the first login, to deal with existing | 359 // on every sign in, not just the first login, to deal with existing |
| 360 // profiles that might not have it set yet). | 360 // profiles that might not have it set yet). |
| 361 StringPrefMember google_services_username; | 361 StringPrefMember google_services_username; |
| 362 google_services_username.Init(prefs::kGoogleServicesUsername, | 362 google_services_username.Init(prefs::kGoogleServicesUsername, |
| 363 user_profile->GetPrefs()); | 363 user_profile->GetPrefs()); |
| 364 google_services_username.SetValue( | 364 google_services_username.SetValue( |
| 365 UserManager::Get()->GetLoggedInUser()->display_email()); | 365 UserManager::Get()->GetLoggedInUser()->display_email()); |
| 366 } | 366 } |
| 367 | 367 |
| 368 // Make sure we flip every profile to not share proxies if the user hasn't | |
| 369 // specified so explicitly. | |
| 370 const PrefService::Preference* use_shared_proxies_pref = | |
| 371 user_profile->GetPrefs()->FindPreference(prefs::kUseSharedProxies); | |
| 372 if (use_shared_proxies_pref->IsDefaultValue()) | |
| 373 user_profile->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false); | |
| 374 | |
| 375 RespectLocalePreference(user_profile); | 368 RespectLocalePreference(user_profile); |
| 376 } | 369 } |
| 377 | 370 |
| 378 void LoginUtilsImpl::InitSessionRestoreStrategy() { | 371 void LoginUtilsImpl::InitSessionRestoreStrategy() { |
| 379 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 372 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 380 bool in_app_mode = chrome::IsRunningInForcedAppMode(); | 373 bool in_app_mode = chrome::IsRunningInForcedAppMode(); |
| 381 | 374 |
| 382 // Are we in kiosk app mode? | 375 // Are we in kiosk app mode? |
| 383 if (in_app_mode) { | 376 if (in_app_mode) { |
| 384 if (command_line->HasSwitch(::switches::kAppModeOAuth2Token)) { | 377 if (command_line->HasSwitch(::switches::kAppModeOAuth2Token)) { |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 bool LoginUtils::IsWhitelisted(const std::string& username) { | 791 bool LoginUtils::IsWhitelisted(const std::string& username) { |
| 799 CrosSettings* cros_settings = CrosSettings::Get(); | 792 CrosSettings* cros_settings = CrosSettings::Get(); |
| 800 bool allow_new_user = false; | 793 bool allow_new_user = false; |
| 801 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 794 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 802 if (allow_new_user) | 795 if (allow_new_user) |
| 803 return true; | 796 return true; |
| 804 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 797 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
| 805 } | 798 } |
| 806 | 799 |
| 807 } // namespace chromeos | 800 } // namespace chromeos |
| OLD | NEW |