diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-26 23:22:48 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-26 23:22:48 +0000 |
commit | 1be4da9dcedb896cf158befdfc4116e92608aa40 (patch) | |
tree | 52bb39a5ea87a4aa9fd22603aac543b2e6b1c212 /chrome/browser/notifications | |
parent | 5ef4520fcb4b6cca3dc8a0d01b9b51a293d69615 (diff) | |
download | chromium_src-1be4da9dcedb896cf158befdfc4116e92608aa40.zip chromium_src-1be4da9dcedb896cf158befdfc4116e92608aa40.tar.gz chromium_src-1be4da9dcedb896cf158befdfc4116e92608aa40.tar.bz2 |
Remove weird dependency on extensions from webui.
Re-plumb extension request messages in a more sane way.
Before, each RVH had ProcessWebUIMessage(), which was
serving as a manual way of plumbing both WebUI and
extension messages to the right place, even though only
a few RVHD responded to either message.
Instead of this, we now just teach more of the stack how
to handle IPC messages in general, and delegate them up
through the stack, giving each layer a chance to handle
them if it knows how.
The result is simpler and smaller:
179 insertions(+), 252 deletions(-)
BUG=80311
Review URL: http://codereview.chromium.org/6901021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications')
-rw-r--r-- | chrome/browser/notifications/balloon_host.cc | 11 | ||||
-rw-r--r-- | chrome/browser/notifications/balloon_host.h | 10 |
2 files changed, 14 insertions, 7 deletions
diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index ff6a035..3d600a0 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -22,6 +22,7 @@ #include "content/common/notification_type.h" #include "content/common/renderer_preferences.h" #include "content/common/view_messages.h" +#include "ipc/ipc_message.h" #include "webkit/glue/webpreferences.h" BalloonHost::BalloonHost(Balloon* balloon) @@ -131,11 +132,11 @@ RenderViewHostDelegate::View* BalloonHost::GetViewDelegate() { return this; } -void BalloonHost::ProcessWebUIMessage( - const ExtensionHostMsg_DomMessage_Params& params) { - if (extension_function_dispatcher_.get()) { - extension_function_dispatcher_->HandleRequest(params); - } +bool BalloonHost::OnMessageReceived(const IPC::Message& message) { + if (extension_function_dispatcher_.get()) + return extension_function_dispatcher_->OnMessageReceived(message); + + return false; } // RenderViewHostDelegate::View methods implemented to allow links to diff --git a/chrome/browser/notifications/balloon_host.h b/chrome/browser/notifications/balloon_host.h index 475d6bd..9a70e61 100644 --- a/chrome/browser/notifications/balloon_host.h +++ b/chrome/browser/notifications/balloon_host.h @@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "base/compiler_specific.h" #include "base/scoped_ptr.h" #include "chrome/browser/extensions/extension_function_dispatcher.h" #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" @@ -23,6 +24,10 @@ class SiteInstance; struct RendererPreferences; struct WebPreferences; +namespace IPC { +class Message; +} + class BalloonHost : public RenderViewHostDelegate, public RenderViewHostDelegate::View, public ExtensionFunctionDispatcher::Delegate, @@ -61,8 +66,6 @@ class BalloonHost : public RenderViewHostDelegate, virtual int GetBrowserWindowID() const; virtual ViewType::Type GetRenderViewType() const; virtual RenderViewHostDelegate::View* GetViewDelegate(); - virtual void ProcessWebUIMessage( - const ExtensionHostMsg_DomMessage_Params& params); // NotificationObserver override. virtual void Observe(NotificationType type, @@ -131,6 +134,9 @@ class BalloonHost : public RenderViewHostDelegate, RenderViewHost* render_view_host_; private: + // RenderViewHostDelegate + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + // Called to send an event that the balloon has been disconnected from // a renderer (if should_notify_on_disconnect_ is true). void NotifyDisconnect(); |