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

Unified Diff: ui/views/drag_utils.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
Index: ui/views/drag_utils.cc
diff --git a/ui/views/drag_utils.cc b/ui/views/drag_utils.cc
index dc068c54fd8a8bae1c8fa35df2a09eedfa01b14f..9c7251fc91f23495045ed748d95b24e29b3d0c1a 100644
--- a/ui/views/drag_utils.cc
+++ b/ui/views/drag_utils.cc
@@ -4,8 +4,7 @@
#include "ui/views/drag_utils.h"
-#include "ui/display/display.h"
-#include "ui/display/screen.h"
+#include "ui/base/layout.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/widget/widget.h"
@@ -16,9 +15,7 @@ float ScaleFactorForDragFromWidget(Widget* widget) {
float device_scale = 1.0f;
if (widget && widget->GetNativeView()) {
gfx::NativeView view = widget->GetNativeView();
- display::Display display =
- display::Screen::GetScreen()->GetDisplayNearestWindow(view);
- device_scale = display.device_scale_factor();
+ device_scale = ui::GetScaleFactorForNativeView(view);
}
return device_scale;
}
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698