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

Unified Diff: chrome/browser/extensions/extension_warning_set.h

Issue 10908119: Replace chrome::NOTIFICATION_EXTENSION_WARNING_CHANGED message with observer pattern Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « no previous file | chrome/browser/extensions/extension_warning_set.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_warning_set.h
diff --git a/chrome/browser/extensions/extension_warning_set.h b/chrome/browser/extensions/extension_warning_set.h
index d2032117bcb920f57114c9beb917daafd7124669..96d02b39bb9899e2c1c15225802c15b6e0212a04 100644
--- a/chrome/browser/extensions/extension_warning_set.h
+++ b/chrome/browser/extensions/extension_warning_set.h
@@ -11,6 +11,7 @@
#include "base/memory/linked_ptr.h"
#include "base/memory/scoped_ptr.h"
+#include "base/observer_list.h"
#include "base/string16.h"
#include "base/threading/non_thread_safe.h"
#include "googleurl/src/gurl.h"
@@ -135,6 +136,11 @@ class ExtensionWarningSet {
// them. This class must be used on the UI thread only.
class ExtensionWarningService : public base::NonThreadSafe {
public:
+ class Observer {
+ public:
+ virtual void ExtensionWarningsChanged() = 0;
+ };
+
// |profile| may be NULL for testing. In this case, be sure to not insert
// any warnings.
explicit ExtensionWarningService(Profile* profile);
@@ -174,6 +180,9 @@ class ExtensionWarningService : public base::NonThreadSafe {
void* profile_id,
scoped_ptr<ExtensionWarningSet> warnings);
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
+
protected:
// Virtual for testing.
virtual void NotifyWarningsChanged();
@@ -194,6 +203,8 @@ class ExtensionWarningService : public base::NonThreadSafe {
std::set<linked_ptr<ExtensionWarning> > badge_suppressions_;
Profile* profile_;
+
+ ObserverList<Observer> observer_list_;
};
} // namespace extensions
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_warning_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698