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

Unified Diff: ui/display/display.cc

Issue 2617623002: Switch RenderWidgetHostViewAndroid to use Screen (Closed)
Patch Set: remove comment change Created 3 years, 11 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 | « ui/display/display.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/display.cc
diff --git a/ui/display/display.cc b/ui/display/display.cc
index f0e31392139a04734376fdb7a57a26e458231223..fb534b97d5eea94298a478f2b2a3fce77324a534 100644
--- a/ui/display/display.cc
+++ b/ui/display/display.cc
@@ -153,6 +153,9 @@ void Display::SetScaleAndBounds(float device_scale_factor,
1.0f / device_scale_factor_),
gfx::ScaleToFlooredSize(bounds_in_pixel.size(),
1.0f / device_scale_factor_));
+#if defined(OS_ANDROID)
+ size_in_pixels_ = bounds_in_pixel.size();
+#endif // defined(OS_ANDROID)
UpdateWorkAreaFromInsets(insets);
}
@@ -170,6 +173,9 @@ void Display::UpdateWorkAreaFromInsets(const gfx::Insets& insets) {
}
gfx::Size Display::GetSizeInPixel() const {
+ // TODO(oshima): This should always use size_in_pixels_.
+ if (!size_in_pixels_.IsEmpty())
+ return size_in_pixels_;
return gfx::ScaleToFlooredSize(size(), device_scale_factor_);
}
« no previous file with comments | « ui/display/display.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698