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

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: Created 7 years, 9 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay))); 576 ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay)));
577 if (delegate_) 577 if (delegate_)
578 delegate_->OnRlzInitialized(user_profile); 578 delegate_->OnRlzInitialized(user_profile);
579 #endif 579 #endif
580 } 580 }
581 581
582 void LoginUtilsImpl::StartSignedInServices(Profile* user_profile) { 582 void LoginUtilsImpl::StartSignedInServices(Profile* user_profile) {
583 // Fetch/Create the SigninManager - this will cause the TokenService to load 583 // Fetch/Create the SigninManager - this will cause the TokenService to load
584 // tokens for the currently signed-in user if the SigninManager hasn't already 584 // tokens for the currently signed-in user if the SigninManager hasn't already
585 // been initialized. 585 // been initialized.
586 SigninManager* signin = SigninManagerFactory::GetForProfile(user_profile); 586 SigninManagerBase* signin =
587 SigninManagerFactory::GetBaseForProfile(user_profile);
587 DCHECK(signin); 588 DCHECK(signin);
588 // Make sure SigninManager is connected to our current user (this should 589 // Make sure SigninManager is connected to our current user (this should
589 // happen automatically because we set kGoogleServicesUsername in 590 // happen automatically because we set kGoogleServicesUsername in
590 // OnProfileCreated()). 591 // OnProfileCreated()).
591 DCHECK_EQ(UserManager::Get()->GetLoggedInUser()->display_email(), 592 DCHECK_EQ(UserManager::Get()->GetLoggedInUser()->display_email(),
592 signin->GetAuthenticatedUsername()); 593 signin->GetAuthenticatedUsername());
593 static bool initialized = false; 594 static bool initialized = false;
594 if (!initialized) { 595 if (!initialized) {
595 initialized = true; 596 initialized = true;
596 // Notify the sync service that signin was successful. Note: Since the sync 597 // Notify the sync service that signin was successful. Note: Since the sync
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 bool LoginUtils::IsWhitelisted(const std::string& username) { 891 bool LoginUtils::IsWhitelisted(const std::string& username) {
891 CrosSettings* cros_settings = CrosSettings::Get(); 892 CrosSettings* cros_settings = CrosSettings::Get();
892 bool allow_new_user = false; 893 bool allow_new_user = false;
893 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 894 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
894 if (allow_new_user) 895 if (allow_new_user)
895 return true; 896 return true;
896 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); 897 return cros_settings->FindEmailInList(kAccountsPrefUsers, username);
897 } 898 }
898 899
899 } // namespace chromeos 900 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/screen_locker.cc » ('j') | chrome/browser/signin/signin_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698