diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-08 21:03:10 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-08 21:03:10 +0000 |
commit | f364d139a49933c7212d521801fec68d1b229487 (patch) | |
tree | 7c4fe037e5a083276962d668369dff201eeaf612 /chrome/browser/notifications/balloon_host.cc | |
parent | 5bba4dd3a7ad928f6c8a58aea8d716605eec285a (diff) | |
download | chromium_src-f364d139a49933c7212d521801fec68d1b229487.zip chromium_src-f364d139a49933c7212d521801fec68d1b229487.tar.gz chromium_src-f364d139a49933c7212d521801fec68d1b229487.tar.bz2 |
Relanding http://src.chromium.org/viewvc/chrome?view=rev&revision=80938.
Add a new RenderViewHostObserver interface for filtering IPCs send to RenderViewHost. This is needed because with TabContentsObserver, an observer might not know which RenderViewHost a message came from duing a pending navigation. A side-benefit is that we only have to add these observers once, instead of remembering/knowing all the delegates that might want to filter these messages.
BUG=78629
Review URL: http://codereview.chromium.org/6813046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications/balloon_host.cc')
-rw-r--r-- | chrome/browser/notifications/balloon_host.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index 1200891..1edeb2f 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -3,8 +3,6 @@ // found in the LICENSE file. #include "chrome/browser/notifications/balloon_host.h" - -#include "chrome/browser/extensions/extension_message_handler.h" #include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/notifications/balloon.h" @@ -71,12 +69,6 @@ const string16& BalloonHost::GetSource() const { return balloon_->notification().display_source(); } -bool BalloonHost::OnMessageReceived(const IPC::Message& message) { - if (!extension_message_handler_.get()) - return false; - return extension_message_handler_->OnMessageReceived(message); -} - WebPreferences BalloonHost::GetWebkitPrefs() { WebPreferences web_prefs = RenderViewHostDelegateHelper::GetWebkitPrefs(GetProfile(), @@ -139,6 +131,13 @@ RenderViewHostDelegate::View* BalloonHost::GetViewDelegate() { return this; } +void BalloonHost::ProcessWebUIMessage( + const ExtensionHostMsg_DomMessage_Params& params) { + if (extension_function_dispatcher_.get()) { + extension_function_dispatcher_->HandleRequest(params); + } +} + // RenderViewHostDelegate::View methods implemented to allow links to // open pages in new tabs. void BalloonHost::CreateNewWindow( @@ -209,11 +208,6 @@ void BalloonHost::Init() { balloon_->notification().content_url()); static_cast<BrowserRenderProcessHost*>(rvh->process())->set_installed_app( installed_app); - - extension_message_handler_.reset(new ExtensionMessageHandler( - rvh->process()->id(), rvh, GetProfile())); - extension_message_handler_->set_extension_function_dispatcher( - extension_function_dispatcher_.get()); } else if (enable_web_ui_) { rvh->AllowBindings(BindingsPolicy::WEB_UI); } |