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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 554733003: Browser Plugin: Move input to RWHVGuest to support interstitial pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_to_guest_rect
Patch Set: Added TODO Created 6 years, 3 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/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 09db70faf74347248dd225ba085087cfe24862c3..b548139fc39466d981c9e95099e7cba50e7d796b 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -128,6 +128,11 @@ WebContentsImpl* BrowserPluginGuest::CreateNewGuestWindow(
bool BrowserPluginGuest::OnMessageReceivedFromEmbedder(
const IPC::Message& message) {
+ RenderWidgetHostViewGuest* rwhv = static_cast<RenderWidgetHostViewGuest*>(
+ web_contents()->GetRenderWidgetHostView());
+ if (rwhv && rwhv->OnMessageReceivedFromEmbedder(message))
Charlie Reis 2014/09/10 00:28:21 Can we pass embedder_web_contents_ here instead of
Fady Samuel 2014/09/10 02:51:37 Done.
+ return true;
+
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuest, message)
IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_CompositorFrameSwappedACK,
@@ -140,8 +145,6 @@ bool BrowserPluginGuest::OnMessageReceivedFromEmbedder(
OnExecuteEditCommand)
IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_ExtendSelectionAndDelete,
OnExtendSelectionAndDelete)
- IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_HandleInputEvent,
- OnHandleInputEvent)
IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_ImeConfirmComposition,
OnImeConfirmComposition)
IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_ImeSetComposition,
@@ -359,9 +362,9 @@ gfx::Point BrowserPluginGuest::GetScreenCoordinates(
gfx::Point screen_pos(relative_position);
screen_pos += guest_window_rect_.OffsetFromOrigin();
- if (embedder_web_contents()->GetBrowserPluginGuest()) {
+ if (embedder_web_contents_->GetBrowserPluginGuest()) {
BrowserPluginGuest* embedder_guest =
- embedder_web_contents()->GetBrowserPluginGuest();
+ embedder_web_contents_->GetBrowserPluginGuest();
screen_pos += embedder_guest->guest_window_rect_.OffsetFromOrigin();
}
return screen_pos;
@@ -631,50 +634,6 @@ void BrowserPluginGuest::OnReclaimCompositorResources(
params.ack);
}
-void BrowserPluginGuest::OnHandleInputEvent(
- int browser_plugin_instance_id,
- const gfx::Rect& guest_window_rect,
- const blink::WebInputEvent* event) {
- RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>(
- GetWebContents()->GetRenderViewHost());
-
- if (blink::WebInputEvent::isMouseEventType(event->type)) {
- guest_rvh->ForwardMouseEvent(
- *static_cast<const blink::WebMouseEvent*>(event));
- return;
- }
-
- if (event->type == blink::WebInputEvent::MouseWheel) {
- guest_rvh->ForwardWheelEvent(
- *static_cast<const blink::WebMouseWheelEvent*>(event));
- return;
- }
-
- if (blink::WebInputEvent::isKeyboardEventType(event->type)) {
- RenderViewHostImpl* embedder_rvh = static_cast<RenderViewHostImpl*>(
- embedder_web_contents_->GetRenderViewHost());
- if (!embedder_rvh->GetLastKeyboardEvent())
- return;
- NativeWebKeyboardEvent keyboard_event(
- *embedder_rvh->GetLastKeyboardEvent());
- guest_rvh->ForwardKeyboardEvent(keyboard_event);
- return;
- }
-
- if (blink::WebInputEvent::isTouchEventType(event->type)) {
- guest_rvh->ForwardTouchEventWithLatencyInfo(
- *static_cast<const blink::WebTouchEvent*>(event),
- ui::LatencyInfo());
- return;
- }
-
- if (blink::WebInputEvent::isGestureEventType(event->type)) {
- guest_rvh->ForwardGestureEvent(
- *static_cast<const blink::WebGestureEvent*>(event));
- return;
- }
-}
-
void BrowserPluginGuest::OnLockMouse(bool user_gesture,
bool last_unlocked_by_target,
bool privileged) {

Powered by Google App Engine
This is Rietveld 408576698