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

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: lazy creation 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..794f5de1f4964bb7aa2c1cd2168cbf7ce845b65d 100644
--- a/content/browser/web_contents/web_contents_view_android.cc
+++ b/content/browser/web_contents/web_contents_view_android.cc
@@ -84,6 +84,7 @@ WebContentsViewAndroid::WebContentsViewAndroid(
content_view_core_(NULL),
delegate_(delegate),
synchronous_compositor_client_(nullptr) {
+ view_.SetViewClient(this);
}
WebContentsViewAndroid::~WebContentsViewAndroid() {
@@ -237,6 +238,25 @@ void WebContentsViewAndroid::RenderViewSwappedIn(RenderViewHost* host) {
void WebContentsViewAndroid::SetOverscrollControllerEnabled(bool enabled) {
}
+bool WebContentsViewAndroid::OnPhysicalBackingSizeChanged(int width,
+ int height) {
+ gfx::Size physical_size(width, height);
+ view_.GetLayer()->SetBounds(physical_size);
boliu 2016/12/02 23:53:22 ditto about keeping the layer in sync
Jinsuk Kim 2016/12/05 11:07:44 Defined UpdateLayerBounds() and called it when phy
+
+ // |SendScreenRects()| indirectly calls GetViewSize() that asks Java layer.
+ web_contents_->SendScreenRects();
+
+ RenderWidgetHostView* rwhv = !web_contents_->ShowingInterstitialPage() ?
+ web_contents_->GetRenderWidgetHostView() :
+ web_contents_->GetInterstitialPage()
+ ->GetMainFrame()
+ ->GetRenderViewHost()
+ ->GetWidget()
+ ->GetView();
+ (static_cast<RenderWidgetHostViewAndroid*>(rwhv))->WasResized();
+ return true;
+}
+
void WebContentsViewAndroid::ShowContextMenu(
RenderFrameHost* render_frame_host, const ContextMenuParams& params) {
if (delegate_)

Powered by Google App Engine
This is Rietveld 408576698