Index: chrome/browser/extensions/extension_function.h |
diff --git a/chrome/browser/extensions/extension_function.h b/chrome/browser/extensions/extension_function.h |
index 21fd897645f7311c1c4b59904b992ae9ab45d08a..8dcae1adde064d853acecf9ba21fa90083ee35eb 100644 |
--- a/chrome/browser/extensions/extension_function.h |
+++ b/chrome/browser/extensions/extension_function.h |
@@ -16,6 +16,7 @@ |
#include "base/process.h" |
#include "chrome/browser/extensions/extension_info_map.h" |
#include "chrome/common/extensions/extension.h" |
+#include "content/browser/renderer_host/render_view_host_observer.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
@@ -212,6 +213,10 @@ class UIThreadExtensionFunction : public ExtensionFunction { |
virtual UIThreadExtensionFunction* AsUIThreadExtensionFunction() OVERRIDE; |
+ // Called when a message was received. |
+ // Should return true if it processed the message. |
+ virtual bool OnMessageReceivedFromRenderView(const IPC::Message& message); |
+ |
// Set the profile which contains the extension that has originated this |
// function call. |
void set_profile(Profile* profile) { profile_ = profile; } |
@@ -282,9 +287,25 @@ class UIThreadExtensionFunction : public ExtensionFunction { |
content::NotificationRegistrar registrar_; |
}; |
+ class ExtensionRenderViewHostObserver : public RenderViewHostObserver { |
Mihai Parparita -not on Chrome
2011/11/15 18:51:42
Does this have to live in ExtensionUIFunction (ins
asargent_no_longer_on_chrome
2011/11/15 18:56:31
We already have the RenderViewHostTracker class de
Jay Civelli
2011/11/18 23:14:32
My case is actually different. The TabContentsObse
Jay Civelli
2011/11/18 23:14:32
Good idea, done.
|
+ public: |
+ ExtensionRenderViewHostObserver(UIThreadExtensionFunction* function, |
+ RenderViewHost* render_view_host); |
+ |
+ private: |
+ virtual void RenderViewHostDestroyed( |
+ RenderViewHost* render_view_host) OVERRIDE; |
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
+ |
+ UIThreadExtensionFunction* function_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ExtensionRenderViewHostObserver); |
+ }; |
+ |
virtual void Destruct() const; |
scoped_ptr<RenderViewHostTracker> tracker_; |
+ scoped_ptr<ExtensionRenderViewHostObserver> render_view_host_observer_; |
}; |
// Extension functions that run on the IO thread. This type of function avoids |