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

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

Issue 10855159: Support Drag and Drop across displays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable DragDropTrackerTest on Win Created 8 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 unified diff | Download patch | Annotate | Revision Log
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 #if defined(USE_AURA) 47 #if defined(USE_AURA)
48 gfx::Point root_location(location); 48 gfx::Point root_location(location);
49 aura::RootWindow* root_window = view->GetRootWindow(); 49 aura::RootWindow* root_window = view->GetRootWindow();
50 aura::Window::ConvertPointToTarget(view, root_window, &root_location); 50 aura::Window::ConvertPointToTarget(view, root_window, &root_location);
51 if (aura::client::GetDragDropClient(root_window)) { 51 if (aura::client::GetDragDropClient(root_window)) {
52 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( 52 aura::client::GetDragDropClient(root_window)->StartDragAndDrop(
53 data, root_location, operation); 53 data, root_window, root_location, operation);
54 } 54 }
55 #elif defined(OS_WIN) 55 #elif defined(OS_WIN)
56 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); 56 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource);
57 DWORD effects; 57 DWORD effects;
58 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), 58 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data),
59 drag_source, 59 drag_source,
60 ui::DragDropTypes::DragOperationToDropEffect(operation), 60 ui::DragDropTypes::DragOperationToDropEffect(operation),
61 &effects); 61 &effects);
62 #endif 62 #endif
63 } 63 }
64 64
65 gfx::Canvas* GetCanvasForDragImage(views::Widget* widget, 65 gfx::Canvas* GetCanvasForDragImage(views::Widget* widget,
66 const gfx::Size& canvas_size) { 66 const gfx::Size& canvas_size) {
67 ui::ScaleFactor device_scale_factor = 67 ui::ScaleFactor device_scale_factor =
68 GetDeviceScaleFactorForNativeView(widget); 68 GetDeviceScaleFactorForNativeView(widget);
69 return new gfx::Canvas(canvas_size, device_scale_factor, false); 69 return new gfx::Canvas(canvas_size, device_scale_factor, false);
70 } 70 }
71 71
72 } // namespace views 72 } // namespace views
OLDNEW
« ash/drag_drop/drag_drop_controller.cc ('K') | « ui/aura/root_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698