summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/render_view_host.h
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/renderer_host/render_view_host.h')
-rw-r--r--content/browser/renderer_host/render_view_host.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h
index 0304ec9..88dac2a 100644
--- a/content/browser/renderer_host/render_view_host.h
+++ b/content/browser/renderer_host/render_view_host.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/memory/scoped_ptr.h"
+#include "base/observer_list.h"
#include "base/process_util.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/common/content_settings_types.h"
@@ -32,6 +33,7 @@ class FilePath;
class GURL;
class ListValue;
class RenderViewHostDelegate;
+class RenderViewHostObserver;
class SessionStorageNamespace;
class SiteInstance;
class SkBitmap;
@@ -499,6 +501,13 @@ class RenderViewHost : public RenderWidgetHost {
GURL* url);
protected:
+ friend class RenderViewHostObserver;
+
+ // Add and remove observers for filtering IPC messages. Clients must be sure
+ // to remove the observer before they go away.
+ void AddObserver(RenderViewHostObserver* observer);
+ void RemoveObserver(RenderViewHostObserver* observer);
+
// RenderWidgetHost protected overrides.
virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
bool* is_keyboard_shortcut);
@@ -682,6 +691,9 @@ class RenderViewHost : public RenderWidgetHost {
// The enabled/disabled states of various commands.
std::map<RenderViewCommand, CommandState> command_states_;
+ // A list of observers that filter messages. Weak references.
+ ObserverList<RenderViewHostObserver> observers_;
+
DISALLOW_COPY_AND_ASSIGN(RenderViewHost);
};