OLD | NEW |
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 Loading... |
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 |
OLD | NEW |