summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_function_dispatcher.h
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-26 23:51:09 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-26 23:51:09 +0000
commit39755c360cd4c5884f590aa0548cdd72d30dbdb0 (patch)
treebf599e2be3b4b226f7be5ca4a3327d22e4561f2b /chrome/browser/extensions/extension_function_dispatcher.h
parent84ec056834c1625b7b7d316817b018564f76e22a (diff)
downloadchromium_src-39755c360cd4c5884f590aa0548cdd72d30dbdb0.zip
chromium_src-39755c360cd4c5884f590aa0548cdd72d30dbdb0.tar.gz
chromium_src-39755c360cd4c5884f590aa0548cdd72d30dbdb0.tar.bz2
Revert 83100 - Remove weird dependency on extensions from webui.Re-plumb extension request messages in a more sane way.Before, each RVH had ProcessWebUIMessage(), which wasserving as a manual way of plumbing both WebUI andextension messages to the right place, even though onlya few RVHD responded to either message.Instead of this, we now just teach more of the stack howto handle IPC messages in general, and delegate them upthrough the stack, giving each layer a chance to handlethem if it knows how.The result is simpler and smaller:179 insertions(+), 252 deletions(-)BUG=80311Review URL: http://codereview.chromium.org/6901021
TBR=aa@chromium.org Review URL: http://codereview.chromium.org/6905045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83103 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_function_dispatcher.h')
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/chrome/browser/extensions/extension_function_dispatcher.h b/chrome/browser/extensions/extension_function_dispatcher.h
index 9f91d9d..cb67988 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.h
+++ b/chrome/browser/extensions/extension_function_dispatcher.h
@@ -11,7 +11,6 @@
#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;
@@ -21,7 +20,7 @@ class ListValue;
class Profile;
class RenderViewHost;
class TabContents;
-struct ExtensionHostMsg_Request_Params;
+struct ExtensionHostMsg_DomMessage_Params;
// A factory function for creating new ExtensionFunction instances.
typedef ExtensionFunction* (*ExtensionFunctionFactory)();
@@ -29,7 +28,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 : public IPC::Channel::Listener {
+class ExtensionFunctionDispatcher {
public:
class Delegate {
public:
@@ -86,8 +85,8 @@ class ExtensionFunctionDispatcher : public IPC::Channel::Listener {
Delegate* delegate() { return delegate_; }
- // If |message| is an extension request, handle it. Returns true if handled.
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ // Handle a request to execute an extension function.
+ void HandleRequest(const ExtensionHostMsg_DomMessage_Params& params);
// Send a response to a function.
void SendResponse(ExtensionFunction* api, bool success);
@@ -122,9 +121,6 @@ class ExtensionFunctionDispatcher : public IPC::Channel::Listener {
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.