summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-12 21:58:18 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-12 21:58:18 +0000
commit8c3dc79bc13ba84f418d3c135e1bf296a3e29722 (patch)
tree32eb9688d500a90eb74a7c4f8cb5a97e507dd0fc /chrome/browser/download
parentabaccb2cb8cff8138e5ea9daf420645e5852c9eb (diff)
downloadchromium_src-8c3dc79bc13ba84f418d3c135e1bf296a3e29722.zip
chromium_src-8c3dc79bc13ba84f418d3c135e1bf296a3e29722.tar.gz
chromium_src-8c3dc79bc13ba84f418d3c135e1bf296a3e29722.tar.bz2
Refactors OSExchangeData for easier portability.
BUG=none TEST=none Review URL: http://codereview.chromium.org/164401 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23230 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_util.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 0d9b5a9..23f47c7 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -29,6 +29,7 @@
#endif
#if defined(OS_WIN)
+#include "app/os_exchange_data_provider_win.h"
#include "base/base_drag_source.h"
#include "views/drag_utils.h"
#endif
@@ -242,14 +243,15 @@ void DragDownload(const DownloadItem* download, SkBitmap* icon) {
DCHECK(download);
// Set up our OLE machinery
- scoped_refptr<OSExchangeData> data(new OSExchangeData);
+ OSExchangeData data;
const FilePath::StringType file_name = download->file_name().value();
if (icon)
- drag_utils::CreateDragImageForFile(file_name, icon, data);
+ drag_utils::CreateDragImageForFile(file_name, icon, &data);
+ data.SetFilename(download->full_path().ToWStringHack());
const FilePath full_path = download->full_path();
- data->SetFilename(full_path.value());
+ data.SetFilename(full_path.value());
std::string mime_type = download->mime_type();
if (mime_type.empty())
@@ -257,14 +259,14 @@ void DragDownload(const DownloadItem* download, SkBitmap* icon) {
// Add URL so that we can load supported files when dragged to TabContents.
if (net::IsSupportedMimeType(mime_type))
- data->SetURL(GURL(full_path.value()), file_name);
+ data.SetURL(GURL(full_path.value()), file_name);
scoped_refptr<BaseDragSource> drag_source(new BaseDragSource);
// Run the drag and drop loop
DWORD effects;
- DoDragDrop(data.get(), drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK,
- &effects);
+ DoDragDrop(OSExchangeDataProviderWin::GetIDataObject(data), drag_source.get(),
+ DROPEFFECT_COPY | DROPEFFECT_LINK, &effects);
#else
NOTIMPLEMENTED();
#endif