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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_drag_drop.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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/bookmarks/bookmark_utils.h" 5 #include "chrome/browser/bookmarks/bookmark_utils.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "chrome/browser/bookmarks/bookmark_node_data.h" 8 #include "chrome/browser/bookmarks/bookmark_node_data.h"
9 #include "ui/base/dragdrop/drag_drop_types.h" 9 #include "ui/base/dragdrop/drag_drop_types.h"
10 #include "ui/base/dragdrop/os_exchange_data.h" 10 #include "ui/base/dragdrop/os_exchange_data.h"
(...skipping 15 matching lines...) Expand all
26 drag_data.Write(profile, &data); 26 drag_data.Write(profile, &data);
27 27
28 // Allow nested message loop so we get DnD events as we drag this around. 28 // Allow nested message loop so we get DnD events as we drag this around.
29 bool was_nested = MessageLoop::current()->IsNested(); 29 bool was_nested = MessageLoop::current()->IsNested();
30 MessageLoop::current()->SetNestableTasksAllowed(true); 30 MessageLoop::current()->SetNestableTasksAllowed(true);
31 31
32 int operation = ui::DragDropTypes::DRAG_COPY | 32 int operation = ui::DragDropTypes::DRAG_COPY |
33 ui::DragDropTypes::DRAG_MOVE | 33 ui::DragDropTypes::DRAG_MOVE |
34 ui::DragDropTypes::DRAG_LINK; 34 ui::DragDropTypes::DRAG_LINK;
35 views::Widget* widget = views::Widget::GetWidgetForNativeView(view); 35 views::Widget* widget = views::Widget::GetWidgetForNativeView(view);
36 // TODO(varunjain): Properly determine and send DRAG_EVENT_SOURCE below.
36 if (widget) { 37 if (widget) {
37 widget->RunShellDrag(NULL, data, gfx::Point(), operation); 38 widget->RunShellDrag(NULL, data, gfx::Point(), operation,
39 ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE);
38 } else { 40 } else {
39 // We hit this case when we're using WebContentsViewWin or 41 // We hit this case when we're using WebContentsViewWin or
40 // WebContentsViewAura, instead of TabContentsViewViews. 42 // WebContentsViewAura, instead of TabContentsViewViews.
41 views::RunShellDrag(view, data, gfx::Point(), operation); 43 views::RunShellDrag(view, data, gfx::Point(), operation,
44 ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE);
42 } 45 }
43 46
44 MessageLoop::current()->SetNestableTasksAllowed(was_nested); 47 MessageLoop::current()->SetNestableTasksAllowed(was_nested);
45 } 48 }
46 49
47 } // namespace bookmark_utils 50 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « chrome/browser/download/download_util.cc ('k') | content/browser/web_contents/web_contents_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698