1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/cocoa/download/download_util_mac.h"
7 #include "base/files/file_path.h"
8 #include "base/strings/sys_string_conversions.h"
10 namespace download_util {
12 void AddFileToPasteboard(NSPasteboard* pasteboard, const base::FilePath& path) {
13 // Write information about the file being dragged to the pasteboard.
14 NSString* file = base::SysUTF8ToNSString(path.value());
15 NSArray* fileList = [NSArray arrayWithObject:file];
16 [pasteboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType]
18 [pasteboard setPropertyList:fileList forType:NSFilenamesPboardType];
21 } // namespace download_util