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

Unified Diff: chrome/browser/signin/signin_tracker.cc

Issue 10020028: Merge 130722 - On ChromeOS, the user is always signed in and we should not (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/signin/signin_tracker.h ('k') | chrome/browser/signin/signin_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/signin_tracker.cc
===================================================================
--- chrome/browser/signin/signin_tracker.cc (revision 131686)
+++ chrome/browser/signin/signin_tracker.cc (working copy)
@@ -27,6 +27,24 @@
profile_(profile),
observer_(observer),
credentials_valid_(false) {
+ Initialize();
+}
+
+SigninTracker::SigninTracker(Profile* profile,
+ Observer* observer,
+ LoginState state)
+ : state_(state),
+ profile_(profile),
+ observer_(observer),
+ credentials_valid_(false) {
+ Initialize();
+}
+
+SigninTracker::~SigninTracker() {
+ ProfileSyncServiceFactory::GetForProfile(profile_)->RemoveObserver(this);
+}
+
+void SigninTracker::Initialize() {
DCHECK(observer_);
// Register for notifications from the SigninManager.
registrar_.Add(this,
@@ -48,12 +66,9 @@
ProfileSyncService* service =
ProfileSyncServiceFactory::GetForProfile(profile_);
service->AddObserver(this);
-}
-SigninTracker::~SigninTracker() {
- ProfileSyncService* service =
- ProfileSyncServiceFactory::GetForProfile(profile_);
- service->RemoveObserver(this);
+ if (state_ == SERVICES_INITIALIZING)
+ HandleServiceStateChange();
}
void SigninTracker::Observe(int type,
@@ -163,4 +178,3 @@
service->GetAuthError().state() == GoogleServiceAuthError::NONE &&
!service->unrecoverable_error_detected());
}
-
« no previous file with comments | « chrome/browser/signin/signin_tracker.h ('k') | chrome/browser/signin/signin_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698