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)); |
+} |