Chromium Code Reviews| 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..57e4e1636912d0d5dc62f5cf921733186ae2d956 100644 |
| --- a/content/browser/browser_plugin/browser_plugin_guest.cc |
| +++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
| @@ -128,6 +128,13 @@ WebContentsImpl* BrowserPluginGuest::CreateNewGuestWindow( |
| bool BrowserPluginGuest::OnMessageReceivedFromEmbedder( |
| const IPC::Message& message) { |
| + RenderWidgetHostViewGuest* rwhv = static_cast<RenderWidgetHostViewGuest*>( |
| + web_contents()->GetRenderWidgetHostView()); |
| + if (rwhv && |
| + rwhv->OnMessageReceivedFromEmbedder(message, embedder_web_contents())) { |
| + return true; |
| + } |
| + |
| bool handled = true; |
| IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuest, message) |
| IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_CompositorFrameSwappedACK, |
| @@ -140,8 +147,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, |
| @@ -264,7 +269,7 @@ bool BrowserPluginGuest::IsGuest(RenderViewHostImpl* render_view_host) { |
| RenderWidgetHostView* BrowserPluginGuest::GetEmbedderRenderWidgetHostView() { |
| if (!attached()) |
| return NULL; |
| - return embedder_web_contents_->GetRenderWidgetHostView(); |
| + return embedder_web_contents()->GetRenderWidgetHostView(); |
|
Charlie Reis
2014/09/10 04:42:04
These changes aren't really necessary anymore.
Fady Samuel
2014/09/10 11:43:44
Done.
|
| } |
| void BrowserPluginGuest::UpdateVisibility() { |
| @@ -377,8 +382,8 @@ void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
| pending_messages_.push_back(linked_ptr<IPC::Message>(msg)); |
| return; |
| } |
| - msg->set_routing_id(embedder_web_contents_->GetRoutingID()); |
| - embedder_web_contents_->Send(msg); |
| + msg->set_routing_id(embedder_web_contents()->GetRoutingID()); |
| + embedder_web_contents()->Send(msg); |
| } |
| void BrowserPluginGuest::DragSourceEndedAt(int client_x, int client_y, |
| @@ -566,7 +571,7 @@ void BrowserPluginGuest::OnDragStatusUpdate(int browser_plugin_instance_id, |
| RenderViewHost* host = GetWebContents()->GetRenderViewHost(); |
| switch (drag_status) { |
| case blink::WebDragStatusEnter: |
| - embedder_web_contents_->GetBrowserPluginEmbedder()->DragEnteredGuest( |
| + embedder_web_contents()->GetBrowserPluginEmbedder()->DragEnteredGuest( |
| this); |
| host->DragTargetDragEnter(drop_data, location, location, mask, 0); |
| break; |
| @@ -574,7 +579,7 @@ void BrowserPluginGuest::OnDragStatusUpdate(int browser_plugin_instance_id, |
| host->DragTargetDragOver(location, location, mask, 0); |
| break; |
| case blink::WebDragStatusLeave: |
| - embedder_web_contents_->GetBrowserPluginEmbedder()->DragLeftGuest(this); |
| + embedder_web_contents()->GetBrowserPluginEmbedder()->DragLeftGuest(this); |
| host->DragTargetDragLeave(); |
| break; |
| case blink::WebDragStatusDrop: |
| @@ -631,50 +636,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) { |
| @@ -828,7 +789,7 @@ void BrowserPluginGuest::OnShowPopup( |
| gfx::Rect translated_bounds(params.bounds); |
| translated_bounds.Offset(guest_window_rect_.OffsetFromOrigin()); |
| BrowserPluginPopupMenuHelper popup_menu_helper( |
| - embedder_web_contents_->GetRenderViewHost(), render_frame_host); |
| + embedder_web_contents()->GetRenderViewHost(), render_frame_host); |
| popup_menu_helper.ShowPopupMenu(translated_bounds, |
| params.item_height, |
| params.item_font_size, |