| 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 RLZTracker::InitRlzFromProfileDelayed( | 646 RLZTracker::InitRlzFromProfileDelayed( |
| 647 user_profile, UserManager::Get()->IsCurrentUserNew(), | 647 user_profile, UserManager::Get()->IsCurrentUserNew(), |
| 648 ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay))); | 648 ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay))); |
| 649 if (delegate_) | 649 if (delegate_) |
| 650 delegate_->OnRlzInitialized(user_profile); | 650 delegate_->OnRlzInitialized(user_profile); |
| 651 #endif | 651 #endif |
| 652 } | 652 } |
| 653 | 653 |
| 654 void LoginUtilsImpl::StartSignedInServices(Profile* user_profile) { | 654 void LoginUtilsImpl::StartSignedInServices(Profile* user_profile) { |
| 655 // Fetch/Create the SigninManager - this will cause the TokenService to load | 655 // Fetch/Create the SigninManager - this will cause the TokenService to load |
| 656 // tokens for the currently signed-in user if the SigninManager hasn't already | 656 // tokens for the currently signed-in user if the SigninManager hasn't |
| 657 // been initialized. | 657 // already been initialized. |
| 658 SigninManager* signin = SigninManagerFactory::GetForProfile(user_profile); | 658 SigninManagerBase* signin = |
| 659 SigninManagerFactory::GetForProfile(user_profile); |
| 659 DCHECK(signin); | 660 DCHECK(signin); |
| 660 // Make sure SigninManager is connected to our current user (this should | 661 // Make sure SigninManager is connected to our current user (this should |
| 661 // happen automatically because we set kGoogleServicesUsername in | 662 // happen automatically because we set kGoogleServicesUsername in |
| 662 // OnProfileCreated()). | 663 // OnProfileCreated()). |
| 663 DCHECK_EQ(UserManager::Get()->GetLoggedInUser()->display_email(), | 664 DCHECK_EQ(UserManager::Get()->GetLoggedInUser()->display_email(), |
| 664 signin->GetAuthenticatedUsername()); | 665 signin->GetAuthenticatedUsername()); |
| 665 static bool initialized = false; | 666 static bool initialized = false; |
| 666 if (!initialized) { | 667 if (!initialized) { |
| 667 initialized = true; | 668 initialized = true; |
| 668 // Notify the sync service that signin was successful. Note: Since the sync | 669 // Notify the sync service that signin was successful. Note: Since the sync |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 bool LoginUtils::IsWhitelisted(const std::string& username) { | 962 bool LoginUtils::IsWhitelisted(const std::string& username) { |
| 962 CrosSettings* cros_settings = CrosSettings::Get(); | 963 CrosSettings* cros_settings = CrosSettings::Get(); |
| 963 bool allow_new_user = false; | 964 bool allow_new_user = false; |
| 964 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 965 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 965 if (allow_new_user) | 966 if (allow_new_user) |
| 966 return true; | 967 return true; |
| 967 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 968 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
| 968 } | 969 } |
| 969 | 970 |
| 970 } // namespace chromeos | 971 } // namespace chromeos |
| OLD | NEW |