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

Unified Diff: chrome/browser/download/download_util.cc

Issue 10541150: aura: Fix draggin files from downloads page. This was broken from when we (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_util.cc
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 59aaedb5416bf1a766469c8e450131ad42d0df24..387a42022c5e4047584f9d8c6411bb9ba61ce4f8 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -78,6 +78,12 @@
#include "ui/base/dragdrop/os_exchange_data_provider_win.h"
#endif
+#if defined(USE_AURA)
+#include "ui/aura/client/drag_drop_client.h"
+#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
+#endif
+
namespace {
// Returns a string constant to be used as the |danger_type| value in
@@ -407,11 +413,12 @@ void DragDownload(const DownloadItem* download,
#if !defined(TOOLKIT_GTK)
#if defined(USE_AURA)
- views::Widget* widget = views::Widget::GetWidgetForNativeView(view);
+ aura::RootWindow* root_window = view->GetRootWindow();
+ if (!root_window || !aura::client::GetDragDropClient(root_window))
+ return;
+
gfx::Point location = gfx::Screen::GetCursorScreenPoint();
- // We do not care about notifying the DragItemView on completion of drag. So
- // we pass NULL to RunShellDrag for the source view.
- widget->RunShellDrag(NULL, data, location,
+ aura::client::GetDragDropClient(root_window)->StartDragAndDrop(data, location,
ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK);
#else // We are on WIN without AURA
// We cannot use Widget::RunShellDrag on WIN since the |view| is backed by a
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698