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

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: fix override 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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 RLZTracker::InitRlzFromProfileDelayed( 630 RLZTracker::InitRlzFromProfileDelayed(
631 user_profile, UserManager::Get()->IsCurrentUserNew(), 631 user_profile, UserManager::Get()->IsCurrentUserNew(),
632 ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay))); 632 ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay)));
633 if (delegate_) 633 if (delegate_)
634 delegate_->OnRlzInitialized(user_profile); 634 delegate_->OnRlzInitialized(user_profile);
635 #endif 635 #endif
636 } 636 }
637 637
638 void LoginUtilsImpl::StartSignedInServices(Profile* user_profile) { 638 void LoginUtilsImpl::StartSignedInServices(Profile* user_profile) {
639 // Fetch/Create the SigninManager - this will cause the TokenService to load 639 // Fetch/Create the SigninManager - this will cause the TokenService to load
640 // tokens for the currently signed-in user if the SigninManager hasn't already 640 // tokens for the currently signed-in user if the SigninManager hasn't
641 // been initialized. 641 // already been initialized.
642 SigninManager* signin = SigninManagerFactory::GetForProfile(user_profile); 642 SigninManagerBase* signin =
643 SigninManagerFactory::GetForProfile(user_profile);
643 DCHECK(signin); 644 DCHECK(signin);
644 // Make sure SigninManager is connected to our current user (this should 645 // Make sure SigninManager is connected to our current user (this should
645 // happen automatically because we set kGoogleServicesUsername in 646 // happen automatically because we set kGoogleServicesUsername in
646 // OnProfileCreated()). 647 // OnProfileCreated()).
647 DCHECK_EQ(UserManager::Get()->GetLoggedInUser()->display_email(), 648 DCHECK_EQ(UserManager::Get()->GetLoggedInUser()->display_email(),
648 signin->GetAuthenticatedUsername()); 649 signin->GetAuthenticatedUsername());
649 static bool initialized = false; 650 static bool initialized = false;
650 if (!initialized) { 651 if (!initialized) {
651 initialized = true; 652 initialized = true;
652 // Notify the sync service that signin was successful. Note: Since the sync 653 // Notify the sync service that signin was successful. Note: Since the sync
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 bool LoginUtils::IsWhitelisted(const std::string& username) { 948 bool LoginUtils::IsWhitelisted(const std::string& username) {
948 CrosSettings* cros_settings = CrosSettings::Get(); 949 CrosSettings* cros_settings = CrosSettings::Get();
949 bool allow_new_user = false; 950 bool allow_new_user = false;
950 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 951 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
951 if (allow_new_user) 952 if (allow_new_user)
952 return true; 953 return true;
953 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); 954 return cros_settings->FindEmailInList(kAccountsPrefUsers, username);
954 } 955 }
955 956
956 } // namespace chromeos 957 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698