| 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/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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 namespace views { | 41 namespace views { |
| 42 | 42 |
| 43 void RunShellDrag(gfx::NativeView view, | 43 void RunShellDrag(gfx::NativeView view, |
| 44 const ui::OSExchangeData& data, | 44 const ui::OSExchangeData& data, |
| 45 const gfx::Point& location, | 45 const gfx::Point& location, |
| 46 int operation, | 46 int operation, |
| 47 ui::DragDropTypes::DragEventSource source) { | 47 ui::DragDropTypes::DragEventSource source) { |
| 48 #if defined(USE_AURA) | 48 #if defined(USE_AURA) |
| 49 gfx::Point root_location(location); | 49 gfx::Point root_location(location); |
| 50 aura::RootWindow* root_window = view->GetRootWindow(); | 50 aura::Window* root_window = view->GetRootWindow(); |
| 51 aura::Window::ConvertPointToTarget(view, root_window, &root_location); | 51 aura::Window::ConvertPointToTarget(view, root_window, &root_location); |
| 52 if (aura::client::GetDragDropClient(root_window)) { | 52 if (aura::client::GetDragDropClient(root_window)) { |
| 53 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( | 53 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( |
| 54 data, root_window, view, root_location, operation, source); | 54 data, root_window, view, root_location, operation, source); |
| 55 } | 55 } |
| 56 #elif defined(OS_WIN) | 56 #elif defined(OS_WIN) |
| 57 scoped_refptr<ui::DragSourceWin> drag_source(new ui::DragSourceWin); | 57 scoped_refptr<ui::DragSourceWin> drag_source(new ui::DragSourceWin); |
| 58 DWORD effects; | 58 DWORD effects; |
| 59 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), | 59 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), |
| 60 drag_source, | 60 drag_source, |
| 61 ui::DragDropTypes::DragOperationToDropEffect(operation), | 61 ui::DragDropTypes::DragOperationToDropEffect(operation), |
| 62 &effects); | 62 &effects); |
| 63 #endif | 63 #endif |
| 64 } | 64 } |
| 65 | 65 |
| 66 gfx::Canvas* GetCanvasForDragImage(views::Widget* widget, | 66 gfx::Canvas* GetCanvasForDragImage(views::Widget* widget, |
| 67 const gfx::Size& canvas_size) { | 67 const gfx::Size& canvas_size) { |
| 68 float device_scale = GetDeviceScaleForNativeView(widget); | 68 float device_scale = GetDeviceScaleForNativeView(widget); |
| 69 return new gfx::Canvas(canvas_size, device_scale, false); | 69 return new gfx::Canvas(canvas_size, device_scale, false); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace views | 72 } // namespace views |
| OLD | NEW |