Index: chrome/browser/ui/cocoa/download/download_item_drag_mac.mm |
diff --git a/chrome/browser/ui/cocoa/download/download_util_mac.mm b/chrome/browser/ui/cocoa/download/download_item_drag_mac.mm |
similarity index 57% |
copy from chrome/browser/ui/cocoa/download/download_util_mac.mm |
copy to chrome/browser/ui/cocoa/download/download_item_drag_mac.mm |
index 363c13d07afd7390974efc3d97d293d8e20414ce..6e6af1295db03961cec69348f6534c1c653d8e22 100644 |
--- a/chrome/browser/ui/cocoa/download/download_util_mac.mm |
+++ b/chrome/browser/ui/cocoa/download/download_item_drag_mac.mm |
@@ -1,37 +1,19 @@ |
-// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-// |
-// Download utility implementation for Mac OS X. |
-#include "chrome/browser/ui/cocoa/download/download_util_mac.h" |
+#include "chrome/browser/download/drag_download_item.h" |
-#include "base/logging.h" |
-#include "base/strings/sys_string_conversions.h" |
+#include "chrome/browser/ui/cocoa/download/download_util_mac.h" |
#include "content/public/browser/download_item.h" |
-#include "content/public/browser/download_manager.h" |
#include "ui/gfx/image/image.h" |
-#include "ui/gfx/native_widget_types.h" |
- |
-using content::DownloadItem; |
- |
-namespace download_util { |
-void AddFileToPasteboard(NSPasteboard* pasteboard, const base::FilePath& path) { |
- // Write information about the file being dragged to the pasteboard. |
- NSString* file = base::SysUTF8ToNSString(path.value()); |
- NSArray* fileList = [NSArray arrayWithObject:file]; |
- [pasteboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] |
- owner:nil]; |
- [pasteboard setPropertyList:fileList forType:NSFilenamesPboardType]; |
-} |
- |
-void DragDownload(const DownloadItem* download, |
- gfx::Image* icon, |
- gfx::NativeView view) { |
- DCHECK_EQ(DownloadItem::COMPLETE, download->GetState()); |
+void DragDownloadItem(const content::DownloadItem* download, |
+ gfx::Image* icon, |
+ gfx::NativeView view) { |
+ DCHECK_EQ(content::DownloadItem::COMPLETE, download->GetState()); |
NSPasteboard* pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard]; |
- AddFileToPasteboard(pasteboard, download->GetTargetFilePath()); |
+ download_util::AddFileToPasteboard(pasteboard, download->GetTargetFilePath()); |
// Synthesize a drag event, since we don't have access to the actual event |
// that initiated a drag (possibly consumed by the Web UI, for example). |
@@ -56,5 +38,3 @@ void DragDownload(const DownloadItem* download, |
source:view |
slideBack:YES]; |
} |
- |
-} // namespace download_util |