OLD | NEW |
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/aura/window.h" | 7 #include "ui/aura/window.h" |
8 #include "ui/aura/window_event_dispatcher.h" | 8 #include "ui/aura/window_event_dispatcher.h" |
9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
10 #include "ui/gfx/display.h" | 10 #include "ui/gfx/display.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 return device_scale; | 27 return device_scale; |
28 } | 28 } |
29 | 29 |
30 namespace views { | 30 namespace views { |
31 | 31 |
32 void RunShellDrag(gfx::NativeView view, | 32 void RunShellDrag(gfx::NativeView view, |
33 const ui::OSExchangeData& data, | 33 const ui::OSExchangeData& data, |
34 const gfx::Point& location, | 34 const gfx::Point& location, |
35 int operation, | 35 int operation, |
36 ui::DragDropTypes::DragEventSource source) { | 36 ui::DragDropTypes::DragEventSource source) { |
| 37 #if !defined(OS_MACOSX) |
37 gfx::Point root_location(location); | 38 gfx::Point root_location(location); |
38 aura::Window* root_window = view->GetRootWindow(); | 39 aura::Window* root_window = view->GetRootWindow(); |
39 aura::Window::ConvertPointToTarget(view, root_window, &root_location); | 40 aura::Window::ConvertPointToTarget(view, root_window, &root_location); |
40 if (aura::client::GetDragDropClient(root_window)) { | 41 if (aura::client::GetDragDropClient(root_window)) { |
41 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( | 42 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( |
42 data, root_window, view, root_location, operation, source); | 43 data, root_window, view, root_location, operation, source); |
43 } | 44 } |
| 45 #endif |
44 } | 46 } |
45 | 47 |
46 gfx::Canvas* GetCanvasForDragImage(views::Widget* widget, | 48 gfx::Canvas* GetCanvasForDragImage(views::Widget* widget, |
47 const gfx::Size& canvas_size) { | 49 const gfx::Size& canvas_size) { |
48 float device_scale = GetDeviceScaleForNativeView(widget); | 50 float device_scale = GetDeviceScaleForNativeView(widget); |
49 return new gfx::Canvas(canvas_size, device_scale, false); | 51 return new gfx::Canvas(canvas_size, device_scale, false); |
50 } | 52 } |
51 | 53 |
52 } // namespace views | 54 } // namespace views |
OLD | NEW |