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

Side by Side Diff: ui/views/drag_utils.cc

Issue 12257016: (Not ready for review!) Toolbar and views high dpi support. Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Cleaned up more useless diffs. Created 7 years, 10 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 unified diff | Download patch
« no previous file with comments | « ui/views/controls/native/native_view_host.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/drag_utils.h" 5 #include "ui/views/drag_utils.h"
6 6
7 #include "ui/gfx/canvas.h" 7 #include "ui/gfx/canvas.h"
8 #include "ui/gfx/size.h" 8 #include "ui/gfx/size.h"
9 9
10 #if defined(USE_AURA) 10 #if defined(USE_AURA)
(...skipping 17 matching lines...) Expand all
28 // The following code should work on other platforms as well. But we do not 28 // The following code should work on other platforms as well. But we do not
29 // yet care about device scale factor on other platforms. So to keep drag and 29 // yet care about device scale factor on other platforms. So to keep drag and
30 // drop behavior on other platforms un-touched, we wrap this in the #if guard. 30 // drop behavior on other platforms un-touched, we wrap this in the #if guard.
31 if (widget && widget->GetNativeView()) { 31 if (widget && widget->GetNativeView()) {
32 gfx::NativeView view = widget->GetNativeView(); 32 gfx::NativeView view = widget->GetNativeView();
33 gfx::Display display = gfx::Screen::GetScreenFor(view)-> 33 gfx::Display display = gfx::Screen::GetScreenFor(view)->
34 GetDisplayNearestWindow(view); 34 GetDisplayNearestWindow(view);
35 device_scale_factor = ui::GetScaleFactorFromScale( 35 device_scale_factor = ui::GetScaleFactorFromScale(
36 display.device_scale_factor()); 36 display.device_scale_factor());
37 } 37 }
38 #elif defined(ENABLE_HIDPI)
39 device_scale_factor = ui::GetMaxScaleFactor();
38 #endif 40 #endif
39 return device_scale_factor; 41 return device_scale_factor;
40 } 42 }
41 43
42 namespace views { 44 namespace views {
43 45
44 void RunShellDrag(gfx::NativeView view, 46 void RunShellDrag(gfx::NativeView view,
45 const ui::OSExchangeData& data, 47 const ui::OSExchangeData& data,
46 const gfx::Point& location, 48 const gfx::Point& location,
47 int operation, 49 int operation,
(...skipping 17 matching lines...) Expand all
65 } 67 }
66 68
67 gfx::Canvas* GetCanvasForDragImage(views::Widget* widget, 69 gfx::Canvas* GetCanvasForDragImage(views::Widget* widget,
68 const gfx::Size& canvas_size) { 70 const gfx::Size& canvas_size) {
69 ui::ScaleFactor device_scale_factor = 71 ui::ScaleFactor device_scale_factor =
70 GetDeviceScaleFactorForNativeView(widget); 72 GetDeviceScaleFactorForNativeView(widget);
71 return new gfx::Canvas(canvas_size, device_scale_factor, false); 73 return new gfx::Canvas(canvas_size, device_scale_factor, false);
72 } 74 }
73 75
74 } // namespace views 76 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/native/native_view_host.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698