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

Unified Diff: ui/display/screen.cc

Issue 2751833004: Reland "Add display::GetDisplayNearestView" (Closed)
Patch Set: Created 3 years, 9 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/screen.h ('k') | ui/display/screen_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/screen.cc
diff --git a/ui/display/screen.cc b/ui/display/screen.cc
index f77133ace84ee5ddf29a8fa9be27130dbfabc3d0..59dec1c71ec351a36b797f5a9c8eb2dc6f078a66 100644
--- a/ui/display/screen.cc
+++ b/ui/display/screen.cc
@@ -34,15 +34,19 @@ void Screen::SetScreenInstance(Screen* instance) {
g_screen = instance;
}
+Display Screen::GetDisplayNearestView(gfx::NativeView view) const {
+ return GetDisplayNearestWindow(GetWindowForView(view));
+}
+
gfx::Rect Screen::ScreenToDIPRectInWindow(gfx::NativeView view,
const gfx::Rect& screen_rect) const {
- float scale = GetDisplayNearestWindow(view).device_scale_factor();
+ float scale = GetDisplayNearestView(view).device_scale_factor();
return ScaleToEnclosingRect(screen_rect, 1.0f / scale);
}
gfx::Rect Screen::DIPToScreenRectInWindow(gfx::NativeView view,
const gfx::Rect& dip_rect) const {
- float scale = GetDisplayNearestWindow(view).device_scale_factor();
+ float scale = GetDisplayNearestView(view).device_scale_factor();
return ScaleToEnclosingRect(dip_rect, scale);
}
« no previous file with comments | « ui/display/screen.h ('k') | ui/display/screen_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698