Add InputEventShim for intercepting RWH messages.

As part of the effort to stop RenderWidgetHost from forwarding
it's messages in OnMessageReceived() on to other classes (which
lead to spooky message-action at a distance), this introduces
a new shim class InputEventShim that allows BrowserPlugin to
override various input event related messages in RenderWidgetHost.

This also simplifies some of the message routing in InputRouter
allowing it to NOT be a IPC::Listner, which again, makes inter-class
relations more explicit.

There should be no functionality change.

Bug: 419087
Change-Id: I75f2f4cc1d1b6d36373c75dc7b4ae7bd7af1afe4
Reviewed-on: https://chromium-review.googlesource.com/c/1274606
Reviewed-by: Albert J. Wong <[email protected]>
Reviewed-by: James MacLean <[email protected]>
Reviewed-by: Nasko Oskov <[email protected]>
Reviewed-by: danakj <[email protected]>
Commit-Queue: Albert J. Wong <[email protected]>
Cr-Commit-Position: refs/heads/master@{#599046}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 8ce6d0d..7bc8f7b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3305,6 +3305,16 @@
   auto_resize_size_ = gfx::Size();
 }
 
+InputEventShim* WebContentsImpl::GetInputEventShim() const {
+  // The only thing that intercepts text input and mouse lock is the
+  // BrowserPluginGuest. Delegate to the BrowserPluginGuest logic for
+  // whether or not it needs to shim these events.
+  if (browser_plugin_guest_) {
+    return browser_plugin_guest_->GetInputEventShim();
+  }
+  return nullptr;
+}
+
 WebContents* WebContentsImpl::OpenURL(const OpenURLParams& params) {
   if (!delegate_) {
     // Embedder can delay setting a delegate on new WebContents with