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

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

Issue 11368072: aura: Add flag to indicate if a drag session is started with touch or mouse. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 1 month 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
« no previous file with comments | « ui/views/drag_utils.h ('k') | ui/views/view.h » ('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 26 matching lines...) Expand all
37 } 37 }
38 #endif 38 #endif
39 return device_scale_factor; 39 return device_scale_factor;
40 } 40 }
41 41
42 namespace views { 42 namespace views {
43 43
44 void RunShellDrag(gfx::NativeView view, 44 void RunShellDrag(gfx::NativeView view,
45 const ui::OSExchangeData& data, 45 const ui::OSExchangeData& data,
46 const gfx::Point& location, 46 const gfx::Point& location,
47 int operation) { 47 int operation,
48 ui::DragDropTypes::DragEventSource source) {
48 #if defined(USE_AURA) 49 #if defined(USE_AURA)
49 gfx::Point root_location(location); 50 gfx::Point root_location(location);
50 aura::RootWindow* root_window = view->GetRootWindow(); 51 aura::RootWindow* root_window = view->GetRootWindow();
51 aura::Window::ConvertPointToTarget(view, root_window, &root_location); 52 aura::Window::ConvertPointToTarget(view, root_window, &root_location);
52 if (aura::client::GetDragDropClient(root_window)) { 53 if (aura::client::GetDragDropClient(root_window)) {
53 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( 54 aura::client::GetDragDropClient(root_window)->StartDragAndDrop(
54 data, root_window, root_location, operation); 55 data, root_window, view, root_location, operation, source);
55 } 56 }
56 #elif defined(OS_WIN) 57 #elif defined(OS_WIN)
57 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); 58 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource);
58 DWORD effects; 59 DWORD effects;
59 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), 60 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data),
60 drag_source, 61 drag_source,
61 ui::DragDropTypes::DragOperationToDropEffect(operation), 62 ui::DragDropTypes::DragOperationToDropEffect(operation),
62 &effects); 63 &effects);
63 #endif 64 #endif
64 } 65 }
65 66
66 gfx::Canvas* GetCanvasForDragImage(views::Widget* widget, 67 gfx::Canvas* GetCanvasForDragImage(views::Widget* widget,
67 const gfx::Size& canvas_size) { 68 const gfx::Size& canvas_size) {
68 ui::ScaleFactor device_scale_factor = 69 ui::ScaleFactor device_scale_factor =
69 GetDeviceScaleFactorForNativeView(widget); 70 GetDeviceScaleFactorForNativeView(widget);
70 return new gfx::Canvas(canvas_size, device_scale_factor, false); 71 return new gfx::Canvas(canvas_size, device_scale_factor, false);
71 } 72 }
72 73
73 } // namespace views 74 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/drag_utils.h ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698