| 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 16 matching lines...) Expand all Loading... |
| 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 if (widget) { | 36 if (widget) { |
| 37 widget->RunShellDrag(NULL, data, gfx::Point(), operation); | 37 widget->RunShellDrag(NULL, data, gfx::Point(), operation, |
| 38 ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE); |
| 38 } else { | 39 } else { |
| 39 // We hit this case when we're using WebContentsViewWin or | 40 // We hit this case when we're using WebContentsViewWin or |
| 40 // WebContentsViewAura, instead of TabContentsViewViews. | 41 // WebContentsViewAura, instead of TabContentsViewViews. |
| 41 views::RunShellDrag(view, data, gfx::Point(), operation); | 42 views::RunShellDrag(view, data, gfx::Point(), operation, |
| 43 ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE); |
| 42 } | 44 } |
| 43 | 45 |
| 44 MessageLoop::current()->SetNestableTasksAllowed(was_nested); | 46 MessageLoop::current()->SetNestableTasksAllowed(was_nested); |
| 45 } | 47 } |
| 46 | 48 |
| 47 } // namespace bookmark_utils | 49 } // namespace bookmark_utils |
| OLD | NEW |