RenderViewHostChanged in WebContentsView

https://crrev.com/c/1112950 didn't quite fix one of the reported bugs
https://crbug.com/854499 about webview not getting key input. This CL
aims to address it by replacing WebContentsView::RenderFrameSwappedIn
with WCV::RenderViewHostChanged, and letting WebContentsImpl call it
upon NotifyViewSwapped.

Verified, with the change above, that updating focus/native view tree
takes effect as expected:
 - Build/install webview apk: ninja -C out/Default webview_system_apk
 - Open Gmail or Amazon app
 - Go to account creation page
 - Verify that click on input form brings up keyboard, and letters
   can be typed in

Bug: 860173, 860235
Change-Id: Iaf2013bcb2990b70ba8197eee86f0ababca54088
Reviewed-on: https://chromium-review.googlesource.com/1126580
Reviewed-by: Charlie Reis <[email protected]>
Commit-Queue: Jinsuk Kim <[email protected]>
Cr-Commit-Position: refs/heads/master@{#574040}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index c6c9a6e1..58eedf0d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4985,6 +4985,8 @@
   for (auto& observer : observers_)
     observer.RenderViewHostChanged(old_host, new_host);
 
+  view_->RenderViewHostChanged(old_host, new_host);
+
   // Ensure that the associated embedder gets cleared after a RenderViewHost
   // gets swapped, so we don't reuse the same embedder next time a
   // RenderViewHost is attached to this WebContents.
@@ -5006,8 +5008,6 @@
 #endif
   for (auto& observer : observers_)
     observer.RenderFrameHostChanged(old_host, new_host);
-
-  view_->RenderFrameSwappedIn(old_host, new_host, is_main_frame);
 }
 
 // TODO(avi): Remove this entire function because this notification is already