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

Unified Diff: content/browser/renderer_host/render_widget_host_input_event_router.cc

Issue 2417693002: Allow MimeHandlerViewGuest be embedded inside OOPIFs (Closed)
Patch Set: Fixed an input routing issue with nested browser plugings Created 4 years, 1 month 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
« no previous file with comments | « content/browser/renderer_host/DEPS ('k') | content/public/browser/browser_plugin_guest_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_input_event_router.cc
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router.cc b/content/browser/renderer_host/render_widget_host_input_event_router.cc
index 3603ae2d83f8e927f3952f95a37ae7d17b8a546e..3e9ebb3a85ce9477d27b40fbe73f58046feffbf1 100644
--- a/content/browser/renderer_host/render_widget_host_input_event_router.cc
+++ b/content/browser/renderer_host/render_widget_host_input_event_router.cc
@@ -12,6 +12,7 @@
#include "cc/surfaces/surface_id_allocator.h"
#include "cc/surfaces/surface_manager.h"
#include "content/browser/frame_host/render_widget_host_view_child_frame.h"
+#include "content/browser/frame_host/render_widget_host_view_guest.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/common/frame_messages.h"
@@ -197,7 +198,25 @@ void RenderWidgetHostInputEventRouter::RouteMouseEvent(
// the embedding renderer and then BrowserPluginGuest.
if (target && target->IsRenderWidgetHostViewGuest()) {
ui::LatencyInfo latency_info;
- root_view->ProcessMouseEvent(*event, latency_info);
+ RenderWidgetHostViewBase* owner_view =
+ static_cast<RenderWidgetHostViewGuest*>(target)
+ ->GetOwnerRenderWidgetHostView();
+ while (owner_view->IsRenderWidgetHostViewGuest()) {
EhsanK 2016/11/15 19:54:22 We need to send all the input events to the embedd
wjmaclean 2016/11/15 20:02:39 The idea of finding the first non-RWHVG owner seem
EhsanK 2016/11/16 21:27:31 Thanks. I added a short comment just to be more cl
+ owner_view = static_cast<RenderWidgetHostViewGuest*>(owner_view)
+ ->GetOwnerRenderWidgetHostView();
+ }
+
+ if (owner_view != root_view) {
+ // This happens when the view is embedded inside a cross-process frame.
+ gfx::Point owner_point;
+ if (!root_view->TransformPointToCoordSpaceForView(
+ gfx::Point(event->x, event->y), owner_view, &owner_point)) {
+ return;
+ }
+ event->x = owner_point.x();
+ event->y = owner_point.y();
+ }
+ owner_view->ProcessMouseEvent(*event, latency_info);
return;
}
« no previous file with comments | « content/browser/renderer_host/DEPS ('k') | content/public/browser/browser_plugin_guest_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698