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

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

Issue 12502017: signin: pull basic SigninManager functionality into new SigninManagerBase class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: megarebase Created 7 years, 8 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
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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 RLZTracker::InitRlzFromProfileDelayed( 642 RLZTracker::InitRlzFromProfileDelayed(
643 user_profile, UserManager::Get()->IsCurrentUserNew(), 643 user_profile, UserManager::Get()->IsCurrentUserNew(),
644 ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay))); 644 ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay)));
645 if (delegate_) 645 if (delegate_)
646 delegate_->OnRlzInitialized(user_profile); 646 delegate_->OnRlzInitialized(user_profile);
647 #endif 647 #endif
648 } 648 }
649 649
650 void LoginUtilsImpl::StartSignedInServices(Profile* user_profile) { 650 void LoginUtilsImpl::StartSignedInServices(Profile* user_profile) {
651 // Fetch/Create the SigninManager - this will cause the TokenService to load 651 // Fetch/Create the SigninManager - this will cause the TokenService to load
652 // tokens for the currently signed-in user if the SigninManager hasn't already 652 // tokens for the currently signed-in user if the SigninManager hasn't
653 // been initialized. 653 // already been initialized.
654 SigninManager* signin = SigninManagerFactory::GetForProfile(user_profile); 654 SigninManagerBase* signin =
655 SigninManagerFactory::GetForProfile(user_profile);
655 DCHECK(signin); 656 DCHECK(signin);
656 // Make sure SigninManager is connected to our current user (this should 657 // Make sure SigninManager is connected to our current user (this should
657 // happen automatically because we set kGoogleServicesUsername in 658 // happen automatically because we set kGoogleServicesUsername in
658 // OnProfileCreated()). 659 // OnProfileCreated()).
659 DCHECK_EQ(UserManager::Get()->GetLoggedInUser()->display_email(), 660 DCHECK_EQ(UserManager::Get()->GetLoggedInUser()->display_email(),
660 signin->GetAuthenticatedUsername()); 661 signin->GetAuthenticatedUsername());
661 static bool initialized = false; 662 static bool initialized = false;
662 if (!initialized) { 663 if (!initialized) {
663 initialized = true; 664 initialized = true;
664 // Notify the sync service that signin was successful. Note: Since the sync 665 // Notify the sync service that signin was successful. Note: Since the sync
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 bool LoginUtils::IsWhitelisted(const std::string& username) { 960 bool LoginUtils::IsWhitelisted(const std::string& username) {
960 CrosSettings* cros_settings = CrosSettings::Get(); 961 CrosSettings* cros_settings = CrosSettings::Get();
961 bool allow_new_user = false; 962 bool allow_new_user = false;
962 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 963 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
963 if (allow_new_user) 964 if (allow_new_user)
964 return true; 965 return true;
965 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); 966 return cros_settings->FindEmailInList(kAccountsPrefUsers, username);
966 } 967 }
967 968
968 } // namespace chromeos 969 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698