diff options
author | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-07 20:52:20 +0000 |
---|---|---|
committer | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-07 20:52:20 +0000 |
commit | 7d3d28ad1c1deb690ed1510eacc684375c10cc10 (patch) | |
tree | 907ee640a1130df939098402fe597b97f62d8a11 /content/browser/web_contents/web_contents_impl.cc | |
parent | 3e515e448979855810e0a87cadbc07e859c5c93c (diff) | |
download | chromium_src-7d3d28ad1c1deb690ed1510eacc684375c10cc10.zip chromium_src-7d3d28ad1c1deb690ed1510eacc684375c10cc10.tar.gz chromium_src-7d3d28ad1c1deb690ed1510eacc684375c10cc10.tar.bz2 |
Pass RenderFrameHost to WebContentObservers' message handlers
This patch enables WebContentsObserver::OnMessageReceived to receive
a reference to RenderFrameHost that received the message.
This allows passing of JavaBridgeDispatcherHostManager ownership from
WebContentsImpl to ContentViewCore and removing of some redundant
initialization code in JavaBridgeDispatcherHostManager, fixing
a long-standing TODO.
Review URL: https://codereview.chromium.org/253013002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268939 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/web_contents/web_contents_impl.cc')
-rw-r--r-- | content/browser/web_contents/web_contents_impl.cc | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index ea872a6..47871dc 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -96,9 +96,7 @@ #if defined(OS_ANDROID) #include "content/browser/android/date_time_chooser_android.h" #include "content/browser/media/android/browser_media_player_manager.h" -#include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h" #include "content/browser/web_contents/web_contents_android.h" -#include "content/common/java_bridge_messages.h" #include "content/public/browser/android/content_view_core.h" #endif @@ -481,9 +479,15 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, ObserverListBase<WebContentsObserver>::Iterator it(observers_); WebContentsObserver* observer; - while ((observer = it.GetNext()) != NULL) - if (observer->OnMessageReceived(message)) - return true; + if (render_frame_host) { + while ((observer = it.GetNext()) != NULL) + if (observer->OnMessageReceived(message, render_frame_host)) + return true; + } else { + while ((observer = it.GetNext()) != NULL) + if (observer->OnMessageReceived(message)) + return true; + } // Message handlers should be aware of which // RenderViewHost/RenderFrameHost sent the message, which is temporarily @@ -553,8 +557,6 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, OnFindMatchRectsReply) IPC_MESSAGE_HANDLER(ViewHostMsg_OpenDateTimeDialog, OnOpenDateTimeDialog) - IPC_MESSAGE_HANDLER_DELAY_REPLY(JavaBridgeHostMsg_GetChannelHandle, - OnJavaBridgeGetChannelHandle) #endif IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP_EX() @@ -1099,8 +1101,6 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, NotificationService::AllBrowserContextsAndSources()); #if defined(OS_ANDROID) - java_bridge_dispatcher_host_manager_.reset( - new JavaBridgeDispatcherHostManager(this)); date_time_chooser_.reset(new DateTimeChooserAndroid()); #endif } @@ -2705,11 +2705,6 @@ void WebContentsImpl::OnOpenDateTimeDialog( value.suggestions); } -void WebContentsImpl::OnJavaBridgeGetChannelHandle(IPC::Message* reply_msg) { - java_bridge_dispatcher_host_manager_->OnGetChannelHandle( - render_frame_message_source_, reply_msg); -} - #endif void WebContentsImpl::OnPepperPluginHung(int plugin_child_id, |