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

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

Issue 9972017: Merge 132127 - Fix downloads page drag/drop in WIN. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: Created 8 years, 8 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
===================================================================
--- chrome/browser/download/download_util.cc (revision 132417)
+++ chrome/browser/download/download_util.cc (working copy)
@@ -397,17 +397,22 @@
}
#if !defined(TOOLKIT_USES_GTK)
+#if defined(USE_AURA)
views::Widget* widget = views::Widget::GetWidgetForNativeView(view);
- // TODO(varunjain): Widget should not be NULL here. But its causing the crash
- // in http://code.google.com/p/chromium/issues/detail?id=120430 Find out why.
- if (!widget || !widget->native_widget())
- 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,
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
+ // TabContentsViewWin, not a NativeWidgetWin.
+ scoped_refptr<ui::DragSource> drag_source(new ui::DragSource);
+ // Run the drag and drop loop
+ DWORD effects;
+ DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data),
+ drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, &effects);
+#endif
#else
GtkWidget* root = gtk_widget_get_toplevel(view);
« 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