summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_function_dispatcher.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/extension_function_dispatcher.h')
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_function_dispatcher.h b/chrome/browser/extensions/extension_function_dispatcher.h
index cb67988..9f91d9d 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.h
+++ b/chrome/browser/extensions/extension_function_dispatcher.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "googleurl/src/gurl.h"
+#include "ipc/ipc_channel.h"
#include "ui/gfx/native_widget_types.h"
class Browser;
@@ -20,7 +21,7 @@ class ListValue;
class Profile;
class RenderViewHost;
class TabContents;
-struct ExtensionHostMsg_DomMessage_Params;
+struct ExtensionHostMsg_Request_Params;
// A factory function for creating new ExtensionFunction instances.
typedef ExtensionFunction* (*ExtensionFunctionFactory)();
@@ -28,7 +29,7 @@ typedef ExtensionFunction* (*ExtensionFunctionFactory)();
// ExtensionFunctionDispatcher receives requests to execute functions from
// Chromium extensions running in a RenderViewHost and dispatches them to the
// appropriate handler. It lives entirely on the UI thread.
-class ExtensionFunctionDispatcher {
+class ExtensionFunctionDispatcher : public IPC::Channel::Listener {
public:
class Delegate {
public:
@@ -85,8 +86,8 @@ class ExtensionFunctionDispatcher {
Delegate* delegate() { return delegate_; }
- // Handle a request to execute an extension function.
- void HandleRequest(const ExtensionHostMsg_DomMessage_Params& params);
+ // If |message| is an extension request, handle it. Returns true if handled.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
// Send a response to a function.
void SendResponse(ExtensionFunction* api, bool success);
@@ -121,6 +122,9 @@ class ExtensionFunctionDispatcher {
const Extension* extension,
const GURL& url);
+ // Message handlers.
+ void OnRequest(const ExtensionHostMsg_Request_Params& params);
+
// We need to keep a pointer to the profile because we use it in the dtor
// in sending EXTENSION_FUNCTION_DISPATCHER_DESTROYED, but by that point
// the render_view_host_ has been deleted.