Index: content/browser/host_zoom_map_impl.h |
diff --git a/content/browser/host_zoom_map_impl.h b/content/browser/host_zoom_map_impl.h |
index 7840188c0d747399cd59fbb42d0871237aafe74f..dcc9e4d7cdff34a8f5693c159e5635620a75a00f 100644 |
--- a/content/browser/host_zoom_map_impl.h |
+++ b/content/browser/host_zoom_map_impl.h |
@@ -10,6 +10,7 @@ |
#include <vector> |
#include "base/compiler_specific.h" |
+#include "base/observer_list.h" |
#include "base/sequenced_task_runner_helpers.h" |
#include "base/supports_user_data.h" |
#include "base/synchronization/lock.h" |
@@ -57,8 +58,19 @@ class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap), |
const NotificationDetails& details) OVERRIDE; |
private: |
+ friend class HostZoomMap::Observer; |
+ |
typedef std::map<std::string, double> HostZoomLevels; |
+ // Add and remove observers. Adding or removing multiple times has no effect. |
+ // The order in which notifications are sent to observers is undefined. |
+ // Clients must be sure to remove the observer before they go away. |
+ void AddObserver(HostZoomMap::Observer* observer); |
+ void RemoveObserver(HostZoomMap::Observer* observer); |
+ |
+ // A list of observers. Weak references. |
+ ObserverList<HostZoomMap::Observer> observers_; |
+ |
// Copy of the pref data, so that we can read it on the IO thread. |
HostZoomLevels host_zoom_levels_; |
double default_zoom_level_; |