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

Unified Diff: ui/views/drag_utils.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler Created 7 years, 3 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/views/controls/menu/native_menu_win.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/drag_utils.cc
diff --git a/ui/views/drag_utils.cc b/ui/views/drag_utils.cc
index 61f4b76878204d51ef1ec7b94c3ac8a777b24154..b156276e5612b4a59c776b50fcbe3f9ac1390f17 100644
--- a/ui/views/drag_utils.cc
+++ b/ui/views/drag_utils.cc
@@ -22,8 +22,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 +32,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 +65,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
« no previous file with comments | « ui/views/controls/menu/native_menu_win.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698