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

Unified Diff: ui/display/display.cc

Issue 2617623002: Switch RenderWidgetHostViewAndroid to use Screen (Closed)
Patch Set: fix? 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') | ui/gfx/android/device_display_info.h » ('j') | 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..a3ec191861cfab9530f54f23f5675f44db1f380b 100644
--- a/ui/display/display.cc
+++ b/ui/display/display.cc
@@ -153,6 +153,7 @@ void Display::SetScaleAndBounds(float device_scale_factor,
1.0f / device_scale_factor_),
gfx::ScaleToFlooredSize(bounds_in_pixel.size(),
1.0f / device_scale_factor_));
+ size_in_pixels_ = bounds_in_pixel.size();
oshima 2017/01/06 19:31:23 Would you mind adding ifdef android for now? I do
boliu 2017/01/06 20:26:21 Done. Also marked the setter android-only to avoid
UpdateWorkAreaFromInsets(insets);
}
@@ -170,6 +171,8 @@ void Display::UpdateWorkAreaFromInsets(const gfx::Insets& insets) {
}
gfx::Size Display::GetSizeInPixel() const {
+ if (!size_in_pixels_.IsEmpty())
+ return size_in_pixels_;
oshima 2017/01/06 19:31:23 can you add this // TODO(oshima): this should alw
boliu 2017/01/06 20:26:21 Done.
return gfx::ScaleToFlooredSize(size(), device_scale_factor_);
}
« no previous file with comments | « ui/display/display.h ('k') | ui/gfx/android/device_display_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698