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

Unified Diff: chrome/browser/chromeos/login/signin/auth_sync_observer.cc

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Use parameter Created 3 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/chromeos/login/signin/auth_sync_observer.cc
diff --git a/chrome/browser/chromeos/login/signin/auth_sync_observer.cc b/chrome/browser/chromeos/login/signin/auth_sync_observer.cc
index f95b305cd491e5213c76559350fef29eb8dccbcb..f86d892f56b87fab97a92e3c8117d38a1694047a 100644
--- a/chrome/browser/chromeos/login/signin/auth_sync_observer.cc
+++ b/chrome/browser/chromeos/login/signin/auth_sync_observer.cc
@@ -47,15 +47,12 @@ void AuthSyncObserver::Shutdown() {
sync_service->RemoveObserver(this);
}
-void AuthSyncObserver::OnStateChanged() {
+void AuthSyncObserver::OnStateChanged(syncer::SyncService* sync) {
DCHECK(user_manager::UserManager::Get()->IsLoggedInAsUserWithGaiaAccount() ||
user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser());
- browser_sync::ProfileSyncService* sync_service =
- ProfileSyncServiceFactory::GetForProfile(profile_);
const user_manager::User* user =
ProfileHelper::Get()->GetUserByProfile(profile_);
- GoogleServiceAuthError::State state =
- sync_service->GetAuthError().state();
+ GoogleServiceAuthError::State state = sync->GetAuthError().state();
if (state != GoogleServiceAuthError::NONE &&
state != GoogleServiceAuthError::CONNECTION_FAILED &&
state != GoogleServiceAuthError::SERVICE_UNAVAILABLE &&
@@ -64,7 +61,7 @@ void AuthSyncObserver::OnStateChanged() {
// needed because sign-out/sign-in solution is suggested to the user.
// TODO(nkostylev): Remove after crosbug.com/25978 is implemented.
LOG(WARNING) << "Invalidate OAuth token because of a sync error: "
- << sync_service->GetAuthError().ToString();
+ << sync->GetAuthError().ToString();
const AccountId& account_id = user->GetAccountId();
DCHECK(account_id.is_valid());
// TODO(nkostyelv): Change observer after active user has changed.

Powered by Google App Engine
This is Rietveld 408576698