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

Unified Diff: ui/base/layout_mac.mm

Issue 2688413007: Add display::GetDisplayNearestView (Closed)
Patch Set: updated log #2 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
Index: ui/base/layout_mac.mm
diff --git a/ui/base/layout_mac.mm b/ui/base/layout_mac.mm
index 27e12e1fa095c49b78ea5e0355e7b30510e2dfd0..574a662a6889f90cafdcaf4154d22b1aefd68eb3 100644
--- a/ui/base/layout_mac.mm
+++ b/ui/base/layout_mac.mm
@@ -4,9 +4,10 @@
#include "ui/base/layout.h"
-#include <Cocoa/Cocoa.h>
+#import <Cocoa/Cocoa.h>
#include "base/mac/sdk_forward_declarations.h"
+#include "ui/display/display.h"
namespace {
@@ -28,6 +29,8 @@ float GetScaleFactorScaleForNativeView(gfx::NativeView view) {
namespace ui {
float GetScaleFactorForNativeView(gfx::NativeView view) {
+ if (display::Display::HasForceDeviceScaleFactor())
+ return display::Display::GetForcedDeviceScaleFactor();
return GetScaleFactorScaleForNativeView(view);
}

Powered by Google App Engine
This is Rietveld 408576698