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

Unified Diff: chrome/browser/ui/global_error_service.cc

Issue 7948003: Update error badge on wrench menu button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments 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/ui/global_error_service.h ('k') | chrome/browser/ui/global_error_service_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/global_error_service.cc
diff --git a/chrome/browser/ui/global_error_service.cc b/chrome/browser/ui/global_error_service.cc
index 566276b21d0094a9e30f91283e0add431318b93e..995020b99d52c21fe30fd07d79dc7d5d2e130165 100644
--- a/chrome/browser/ui/global_error_service.cc
+++ b/chrome/browser/ui/global_error_service.cc
@@ -8,8 +8,10 @@
#include "base/stl_util.h"
#include "chrome/browser/ui/global_error.h"
+#include "chrome/common/chrome_notification_types.h"
+#include "content/common/notification_service.h"
-GlobalErrorService::GlobalErrorService() {
+GlobalErrorService::GlobalErrorService(Profile* profile) : profile_(profile) {
}
GlobalErrorService::~GlobalErrorService() {
@@ -18,10 +20,12 @@ GlobalErrorService::~GlobalErrorService() {
void GlobalErrorService::AddGlobalError(GlobalError* error) {
errors_.push_back(error);
+ NotifyErrorsChanged(error);
}
void GlobalErrorService::RemoveGlobalError(GlobalError* error) {
errors_.erase(std::find(errors_.begin(), errors_.end(), error));
+ NotifyErrorsChanged(error);
}
GlobalError* GlobalErrorService::GetGlobalErrorByMenuItemCommandID(
@@ -54,3 +58,10 @@ GlobalError* GlobalErrorService::GetFirstGlobalErrorWithBubbleView() const {
}
return NULL;
}
+
+void GlobalErrorService::NotifyErrorsChanged(GlobalError* error) {
+ NotificationService::current()->Notify(
+ chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED,
+ Source<Profile>(profile_),
+ Details<GlobalError>(error));
+}
« no previous file with comments | « chrome/browser/ui/global_error_service.h ('k') | chrome/browser/ui/global_error_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698