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

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

Issue 12077030: Allow signin to continue even if sync is disabled by policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed mac tests. Created 7 years, 11 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
Index: chrome/browser/signin/about_signin_internals.cc
diff --git a/chrome/browser/signin/about_signin_internals.cc b/chrome/browser/signin/about_signin_internals.cc
index e75d3ef53c9a436cd90e1aa04ea566a708adbc68..e58570ece5e7aa421251defbd9694ad1575b91d6 100644
--- a/chrome/browser/signin/about_signin_internals.cc
+++ b/chrome/browser/signin/about_signin_internals.cc
@@ -204,10 +204,15 @@ void AboutSigninInternals::Initialize(Profile* profile) {
}
void AboutSigninInternals::Shutdown() {
- SigninManagerFactory::GetForProfile(profile_)->
- RemoveSigninDiagnosticsObserver(this);
- TokenServiceFactory::GetForProfile(profile_)->
- RemoveSigninDiagnosticsObserver(this);
+ SigninManager* signin = SigninManagerFactory::GetForProfile(profile_);
+ // Some unit tests do stuff like switching profiles to incognito in mid-test,
+ // so there may not always be
+ if (signin)
+ signin->RemoveSigninDiagnosticsObserver(this);
+
+ TokenService* token = TokenServiceFactory::GetForProfile(profile_);
+ if (token)
+ token->RemoveSigninDiagnosticsObserver(this);
}
void AboutSigninInternals::NotifyObservers() {

Powered by Google App Engine
This is Rietveld 408576698