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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 11817045: Move auth-error reporting code out of SyncGlobalError and into SigninGlobalError (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disabled ExtensionActionContextMenuTest.BrowserAction 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
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/browser/sync/profile_sync_service_harness.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 7296d00c7ff17ba0d91004e69474f95af49f720a..f5a1945eaca019addc39afabcba06db7cde9bbe2 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -162,6 +162,8 @@ ProfileSyncService::ProfileSyncService(ProfileSyncComponentsFactory* factory,
channel == chrome::VersionInfo::CHANNEL_BETA) {
sync_service_url_ = GURL(kSyncServerUrl);
}
+ if (signin_)
+ signin_->signin_global_error()->AddProvider(this);
}
ProfileSyncService::~ProfileSyncService() {
@@ -532,6 +534,9 @@ void ProfileSyncService::Shutdown() {
// use it.
invalidator_registrar_.reset();
+ if (signin_)
+ signin_->signin_global_error()->RemoveProvider(this);
+
ShutdownImpl(false);
}
@@ -590,7 +595,9 @@ void ProfileSyncService::ShutdownImpl(bool sync_disabled) {
encrypt_everything_ = false;
encrypted_types_ = syncer::SyncEncryptionHandler::SensitiveTypes();
passphrase_required_reason_ = syncer::REASON_PASSPHRASE_NOT_REQUIRED;
- last_auth_error_ = AuthError::None();
+ // Revert to "no auth error".
+ if (last_auth_error_.state() != GoogleServiceAuthError::NONE)
+ UpdateAuthErrorState(GoogleServiceAuthError::None());
if (sync_global_error_.get()) {
GlobalErrorServiceFactory::GetForProfile(profile_)->RemoveGlobalError(
@@ -916,6 +923,8 @@ void ProfileSyncService::UpdateAuthErrorState(const AuthError& error) {
// Fan the notification out to interested UI-thread components.
NotifyObservers();
+ if (signin())
+ signin()->signin_global_error()->AuthStatusChanged();
}
namespace {
@@ -1216,6 +1225,10 @@ const AuthError& ProfileSyncService::GetAuthError() const {
return last_auth_error_;
}
+GoogleServiceAuthError ProfileSyncService::GetAuthStatus() const {
+ return GetAuthError();
+}
+
bool ProfileSyncService::FirstSetupInProgress() const {
return !HasSyncSetupCompleted() && setup_in_progress_;
}
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/browser/sync/profile_sync_service_harness.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698