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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2268323003: Initialize RWHV with default bounds rather than only size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 9fdece94aec860141768144e404d4c48d78b5286..f9db946fc84e047adeee1022f3bf210bfb37e9cd 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -386,11 +386,11 @@ void RenderWidgetHostViewAndroid::WasResized() {
void RenderWidgetHostViewAndroid::SetSize(const gfx::Size& size) {
// Ignore the given size as only the Java code has the power to
no sievers 2016/08/23 21:24:39 Hmm looks like we don't implement this function co
Yusuf 2016/08/23 21:30:47 I think until now, we pretty much ignored any setS
// resize the view on Android.
- default_size_ = size;
+ default_bounds_ = gfx::Rect(default_bounds_.origin(), size);
}
void RenderWidgetHostViewAndroid::SetBounds(const gfx::Rect& rect) {
- SetSize(rect.size());
+ default_bounds_ = rect;
}
void RenderWidgetHostViewAndroid::GetScaledContentBitmap(
@@ -548,7 +548,7 @@ void RenderWidgetHostViewAndroid::ReleaseLocksOnSurface() {
gfx::Rect RenderWidgetHostViewAndroid::GetViewBounds() const {
if (!content_view_core_)
- return gfx::Rect(default_size_);
+ return default_bounds_;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableOSKOverscroll))
@@ -559,14 +559,18 @@ gfx::Rect RenderWidgetHostViewAndroid::GetViewBounds() const {
gfx::Size RenderWidgetHostViewAndroid::GetVisibleViewportSize() const {
if (!content_view_core_)
- return default_size_;
+ return default_bounds_.size();
return content_view_core_->GetViewSize();
}
gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const {
if (!content_view_core_)
no sievers 2016/08/23 21:24:39 missing braces
- return gfx::Size();
+ if (default_bounds_.IsEmpty()) return gfx::Size();
+ return gfx::Size(default_bounds_.right()
+ * ui::GetScaleFactorForNativeView(GetNativeView()),
+ default_bounds_.bottom()
+ * ui::GetScaleFactorForNativeView(GetNativeView()));
return content_view_core_->GetPhysicalBackingSize();
}
@@ -580,7 +584,7 @@ bool RenderWidgetHostViewAndroid::DoTopControlsShrinkBlinkSize() const {
float RenderWidgetHostViewAndroid::GetTopControlsHeight() const {
if (!content_view_core_)
- return 0.f;
+ return default_bounds_.x();
// The height of the top controls.
return content_view_core_->GetTopControlsHeightDip();
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698