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

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

Issue 23271005: Move DragDownload() out of download_util.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: drag_download_item Created 7 years, 4 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
Index: chrome/browser/download/drag_download_item_views.cc
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/drag_download_item_views.cc
similarity index 78%
rename from chrome/browser/download/download_util.cc
rename to chrome/browser/download/drag_download_item_views.cc
index dd4cf1f3897f77dd0bcac3188563de4dc9c3bcdc..a1c50da07253256a84fc4a85343b5f3ea4bf3b94 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/drag_download_item_views.cc
@@ -2,28 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/download/download_util.h"
+#include "chrome/browser/download/drag_download_item.h"
#include <string>
#include "content/public/browser/download_item.h"
#include "net/base/mime_util.h"
#include "net/base/net_util.h"
-#include "ui/gfx/image/image.h"
-#include "ui/gfx/point.h"
-#include "url/gurl.h"
-
-#if defined(TOOLKIT_VIEWS)
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/drag_utils.h"
#include "ui/base/dragdrop/os_exchange_data.h"
+#include "ui/gfx/image/image.h"
+#include "ui/gfx/point.h"
#include "ui/gfx/screen.h"
#include "ui/views/widget/widget.h"
-#endif
-
-#if defined(TOOLKIT_GTK)
-#include "chrome/browser/ui/gtk/custom_drag.h"
-#endif // defined(TOOLKIT_GTK)
+#include "url/gurl.h"
#if defined(OS_WIN) && !defined(USE_AURA)
#include "ui/base/dragdrop/drag_source_win.h"
@@ -36,17 +29,11 @@
#include "ui/aura/window.h"
#endif
-namespace download_util {
-
-using content::DownloadItem;
-
-#if defined(TOOLKIT_VIEWS)
-// Download dragging
-void DragDownload(const DownloadItem* download,
- gfx::Image* icon,
- gfx::NativeView view) {
+void DragDownloadItem(const content::DownloadItem* download,
+ gfx::Image* icon,
+ gfx::NativeView view) {
DCHECK(download);
- DCHECK_EQ(DownloadItem::COMPLETE, download->GetState());
+ DCHECK_EQ(content::DownloadItem::COMPLETE, download->GetState());
// Set up our OLE machinery
ui::OSExchangeData data;
@@ -91,7 +78,9 @@ void DragDownload(const DownloadItem* download,
// Run the drag and drop loop
DWORD effects;
DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data),
- drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, &effects);
+ drag_source.get(),
+ DROPEFFECT_COPY | DROPEFFECT_LINK,
+ &effects);
#endif
#else
@@ -108,12 +97,3 @@ void DragDownload(const DownloadItem* download,
ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK);
#endif // TOOLKIT_GTK
}
-#elif defined(USE_X11)
-void DragDownload(const DownloadItem* download,
- gfx::Image* icon,
- gfx::NativeView view) {
- DownloadItemDrag::BeginDrag(download, icon);
-}
-#endif // USE_X11
-
-} // namespace download_util
« no previous file with comments | « chrome/browser/download/drag_download_item_gtk.cc ('k') | chrome/browser/extensions/api/downloads/downloads_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698