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

Unified Diff: content/browser/web_contents/web_contents_view_android.cc

Issue 2502763003: Introduce ViewRoot to forward input/view events to native (Closed)
Patch Set: WindowAndroid.GetEventHandler Created 4 years 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
Index: content/browser/web_contents/web_contents_view_android.cc
diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc
index 0dc8bf471cc26e6bdadcf88854b21981f2e4fa66..f63a72dbd223a6328bcfef444e07430421cbb9b7 100644
--- a/content/browser/web_contents/web_contents_view_android.cc
+++ b/content/browser/web_contents/web_contents_view_android.cc
@@ -83,8 +83,8 @@ WebContentsViewAndroid::WebContentsViewAndroid(
: web_contents_(web_contents),
content_view_core_(NULL),
delegate_(delegate),
- synchronous_compositor_client_(nullptr) {
-}
+ view_(this),
+ synchronous_compositor_client_(nullptr) {}
WebContentsViewAndroid::~WebContentsViewAndroid() {
if (view_.GetLayer())
@@ -237,6 +237,21 @@ void WebContentsViewAndroid::RenderViewSwappedIn(RenderViewHost* host) {
void WebContentsViewAndroid::SetOverscrollControllerEnabled(bool enabled) {
}
+void WebContentsViewAndroid::OnPhysicalBackingSizeChanged(int width,
+ int height) {
+ // |SendScreenRects()| indirectly calls GetViewSize() that asks Java layer.
+ web_contents_->SendScreenRects();
boliu 2016/12/06 23:15:46 so this code is duplicated from ContentViewCoreImp
Jinsuk Kim 2016/12/07 12:36:28 Done.
+
+ RenderWidgetHostView* rwhv = !web_contents_->ShowingInterstitialPage() ?
+ web_contents_->GetRenderWidgetHostView() :
+ web_contents_->GetInterstitialPage()
+ ->GetMainFrame()
+ ->GetRenderViewHost()
+ ->GetWidget()
+ ->GetView();
+ (static_cast<RenderWidgetHostViewAndroid*>(rwhv))->WasResized();
+}
+
void WebContentsViewAndroid::ShowContextMenu(
RenderFrameHost* render_frame_host, const ContextMenuParams& params) {
if (delegate_)

Powered by Google App Engine
This is Rietveld 408576698