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

Unified Diff: ui/base/layout.cc

Issue 2739113002: Simplify calls for scale factor (Closed)
Patch Set: nit 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/aura/window_tree_host_x11.cc ('k') | ui/base/layout_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/layout.cc
diff --git a/ui/base/layout.cc b/ui/base/layout.cc
index 06595c34914e93a8e31c30b0d468f339b65e7441..bbefce002633e28d445d26ea7d58cc81ecfa9b6a 100644
--- a/ui/base/layout.cc
+++ b/ui/base/layout.cc
@@ -106,9 +106,10 @@ ScopedSetSupportedScaleFactors::~ScopedSetSupportedScaleFactors() {
#if !defined(OS_MACOSX)
float GetScaleFactorForNativeView(gfx::NativeView view) {
- return display::Screen::GetScreen()
- ->GetDisplayNearestWindow(view)
- .device_scale_factor();
+ display::Display display =
+ display::Screen::GetScreen()->GetDisplayNearestWindow(view);
+ DCHECK(display.is_valid());
+ return display.device_scale_factor();
}
#endif // !defined(OS_MACOSX)
« no previous file with comments | « ui/aura/window_tree_host_x11.cc ('k') | ui/base/layout_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698