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

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

Issue 7978013: Update global error UI on sync error change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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/sync_global_error.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_global_error.cc
diff --git a/chrome/browser/sync/sync_global_error.cc b/chrome/browser/sync/sync_global_error.cc
index 5e23e1d952e30de94709dc74bacaea7f2971b844..f57d7ae50ec5b84553136632c097c77bb6ab7870 100644
--- a/chrome/browser/sync/sync_global_error.cc
+++ b/chrome/browser/sync/sync_global_error.cc
@@ -7,6 +7,8 @@
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_observer.h"
#include "chrome/browser/sync/sync_ui_util.h"
+#include "chrome/browser/ui/global_error_service.h"
+#include "chrome/browser/ui/global_error_service_factory.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -17,7 +19,8 @@ typedef GoogleServiceAuthError AuthError;
using namespace sync_ui_util;
SyncGlobalError::SyncGlobalError(ProfileSyncService* service)
- : service_(service) {
+ : has_error_(false),
+ service_(service) {
OnStateChanged();
}
@@ -93,7 +96,13 @@ void SyncGlobalError::BubbleViewCancelButtonPressed() {
}
void SyncGlobalError::OnStateChanged() {
- // TODO(sail): Update the wrench menu button.
+ bool new_has_error = GetStatusLabelsForSyncGlobalError(
+ service_, NULL, NULL, NULL) == SYNC_ERROR;
+ if (new_has_error != has_error_) {
+ has_error_ = new_has_error;
+ GlobalErrorServiceFactory::GetForProfile(
+ service_->profile())->NotifyErrorsChanged(this);
+ }
}
bool SyncGlobalError::HasCustomizedSyncMenuItem() {
« no previous file with comments | « chrome/browser/sync/sync_global_error.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698