| Index: ui/views/drag_utils.cc
|
| diff --git a/ui/views/drag_utils.cc b/ui/views/drag_utils.cc
|
| index 61f4b76878204d51ef1ec7b94c3ac8a777b24154..8569381057963192c301123ddac75a1c2ab2d60a 100644
|
| --- a/ui/views/drag_utils.cc
|
| +++ b/ui/views/drag_utils.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "ui/views/drag_utils.h"
|
|
|
| +#include "ui/base/layout.h"
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/gfx/size.h"
|
|
|
| @@ -22,8 +23,8 @@
|
| #error
|
| #endif
|
|
|
| -ui::ScaleFactor GetDeviceScaleFactorForNativeView(views::Widget* widget) {
|
| - ui::ScaleFactor device_scale_factor = ui::SCALE_FACTOR_100P;
|
| +float GetDeviceScaleForNativeView(views::Widget* widget) {
|
| + float device_scale = 1.0f;
|
| #if defined(USE_AURA)
|
| // The following code should work on other platforms as well. But we do not
|
| // yet care about device scale factor on other platforms. So to keep drag and
|
| @@ -32,11 +33,10 @@ ui::ScaleFactor GetDeviceScaleFactorForNativeView(views::Widget* widget) {
|
| gfx::NativeView view = widget->GetNativeView();
|
| gfx::Display display = gfx::Screen::GetScreenFor(view)->
|
| GetDisplayNearestWindow(view);
|
| - device_scale_factor = ui::GetScaleFactorFromScale(
|
| - display.device_scale_factor());
|
| + device_scale = display.device_scale_factor();
|
| }
|
| #endif
|
| - return device_scale_factor;
|
| + return device_scale;
|
| }
|
|
|
| namespace views {
|
| @@ -66,9 +66,8 @@ void RunShellDrag(gfx::NativeView view,
|
|
|
| gfx::Canvas* GetCanvasForDragImage(views::Widget* widget,
|
| const gfx::Size& canvas_size) {
|
| - ui::ScaleFactor device_scale_factor =
|
| - GetDeviceScaleFactorForNativeView(widget);
|
| - return new gfx::Canvas(canvas_size, device_scale_factor, false);
|
| + float device_scale = GetDeviceScaleForNativeView(widget);
|
| + return new gfx::Canvas(canvas_size, device_scale, false);
|
| }
|
|
|
| } // namespace views
|
|
|