Implement surface-based browser process hit testing for Mac and Aura
For efficient input handling with out-of-process iframes, events need to be routed directly to the correct renderer process that will end up handling the event (rather than forwarding from renderer process to renderer process, as we have been doing previously). This patch causes RenderWidgetHostViewAura and RenderWidgetHostViewMac to send mouse and mousewheel events to a routing class that performs a hit test base on the event's coordinates and forwards to the correct RenderWidgetHostView.
This should only have an affect when running in Site-per-process mode. Otherwise the hit test gets short circuited because there is only one RenderWidgetHostView per tab.
BUG=491334
Review URL: https://codereview.chromium.org/1255483004
Cr-Commit-Position: refs/heads/master@{#347008}
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index f596b004..3299280f 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -61,6 +61,7 @@
class RenderViewHost;
class RenderViewHostDelegateView;
class RenderWidgetHostImpl;
+class RenderWidgetHostInputEventRouter;
class SavePackage;
class ScreenOrientationDispatcherHost;
class SiteInstance;
@@ -584,6 +585,7 @@
void SelectRange(const gfx::Point& base, const gfx::Point& extent) override;
void AdjustSelectionByCharacterOffset(int start_adjust, int end_adjust)
override;
+ RenderWidgetHostInputEventRouter* GetInputEventRouter() override;
// RenderFrameHostManager::Delegate ------------------------------------------
@@ -1300,6 +1302,8 @@
scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_;
#endif
+ scoped_ptr<RenderWidgetHostInputEventRouter> rwh_input_event_router_;
+
base::WeakPtrFactory<WebContentsImpl> loading_weak_factory_;
DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);