Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 275873002: Re-land "Pass RenderFrameHost to WebContentObservers' message handlers" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index c1b9be8748aba888774c7a011ff53a0765806289..16e0b6d1436ad8735711ace639d401cedb78c27f 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,

Powered by Google App Engine
This is Rietveld 408576698