| OLD | NEW |
| 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 "chrome/browser/bookmarks/bookmark_utils.h" | 5 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 bool was_nested = MessageLoop::current()->IsNested(); | 354 bool was_nested = MessageLoop::current()->IsNested(); |
| 355 MessageLoop::current()->SetNestableTasksAllowed(true); | 355 MessageLoop::current()->SetNestableTasksAllowed(true); |
| 356 | 356 |
| 357 int operation = | 357 int operation = |
| 358 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_MOVE | | 358 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_MOVE | |
| 359 ui::DragDropTypes::DRAG_LINK; | 359 ui::DragDropTypes::DRAG_LINK; |
| 360 views::Widget* widget = views::Widget::GetWidgetForNativeView(view); | 360 views::Widget* widget = views::Widget::GetWidgetForNativeView(view); |
| 361 if (widget) { | 361 if (widget) { |
| 362 widget->RunShellDrag(NULL, data, gfx::Point(), operation); | 362 widget->RunShellDrag(NULL, data, gfx::Point(), operation); |
| 363 } else { | 363 } else { |
| 364 // We hit this case when we're using TabContentsViewWin or | 364 // We hit this case when we're using WebContentsViewWin or |
| 365 // TabContentsViewAura, instead of TabContentsViewViews. | 365 // WebContentsViewAura, instead of TabContentsViewViews. |
| 366 views::RunShellDrag(view, data, gfx::Point(), operation); | 366 views::RunShellDrag(view, data, gfx::Point(), operation); |
| 367 } | 367 } |
| 368 | 368 |
| 369 MessageLoop::current()->SetNestableTasksAllowed(was_nested); | 369 MessageLoop::current()->SetNestableTasksAllowed(was_nested); |
| 370 #elif defined(OS_MACOSX) | 370 #elif defined(OS_MACOSX) |
| 371 // Allow nested message loop so we get DnD events as we drag this around. | 371 // Allow nested message loop so we get DnD events as we drag this around. |
| 372 bool was_nested = MessageLoop::current()->IsNested(); | 372 bool was_nested = MessageLoop::current()->IsNested(); |
| 373 MessageLoop::current()->SetNestableTasksAllowed(true); | 373 MessageLoop::current()->SetNestableTasksAllowed(true); |
| 374 bookmark_pasteboard_helper_mac::StartDrag(profile, nodes, view); | 374 bookmark_pasteboard_helper_mac::StartDrag(profile, nodes, view); |
| 375 MessageLoop::current()->SetNestableTasksAllowed(was_nested); | 375 MessageLoop::current()->SetNestableTasksAllowed(was_nested); |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 void RecordBookmarkLaunch(BookmarkLaunchLocation location) { | 774 void RecordBookmarkLaunch(BookmarkLaunchLocation location) { |
| 775 #if defined(OS_WIN) | 775 #if defined(OS_WIN) |
| 776 // TODO(estade): do this on other platforms too. For now it's compiled out | 776 // TODO(estade): do this on other platforms too. For now it's compiled out |
| 777 // so that stats from platforms for which this is incompletely implemented | 777 // so that stats from platforms for which this is incompletely implemented |
| 778 // don't mix in with Windows, where it should be implemented exhaustively. | 778 // don't mix in with Windows, where it should be implemented exhaustively. |
| 779 UMA_HISTOGRAM_ENUMERATION("Bookmarks.LaunchLocation", location, LAUNCH_LIMIT); | 779 UMA_HISTOGRAM_ENUMERATION("Bookmarks.LaunchLocation", location, LAUNCH_LIMIT); |
| 780 #endif | 780 #endif |
| 781 } | 781 } |
| 782 | 782 |
| 783 } // namespace bookmark_utils | 783 } // namespace bookmark_utils |
| OLD | NEW |