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

Side by Side Diff: base/file_util_mac.mm

Issue 9346013: Publish app shortcuts on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/mac/bundle_locations.mm » ('j') | base/mac/foundation_util.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_util.h" 5 #include "base/file_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #include <copyfile.h> 8 #include <copyfile.h>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/mac/foundation_util.h"
12 #include "base/string_util.h" 13 #include "base/string_util.h"
13 #include "base/threading/thread_restrictions.h" 14 #include "base/threading/thread_restrictions.h"
14 15
15 namespace file_util { 16 namespace file_util {
16 17
17 bool GetTempDir(FilePath* path) { 18 bool GetTempDir(FilePath* path) {
18 NSString* tmp = NSTemporaryDirectory(); 19 NSString* tmp = NSTemporaryDirectory();
19 if (tmp == nil) 20 if (tmp == nil)
20 return false; 21 return false;
21 *path = FilePath([tmp fileSystemRepresentation]); 22 *path = base::mac::NSStringToFilePath(tmp);
22 return true; 23 return true;
23 } 24 }
24 25
25 bool GetShmemTempDir(FilePath* path, bool executable) { 26 bool GetShmemTempDir(FilePath* path, bool executable) {
26 return GetTempDir(path); 27 return GetTempDir(path);
27 } 28 }
28 29
29 bool CopyFile(const FilePath& from_path, const FilePath& to_path) { 30 bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
30 base::ThreadRestrictions::AssertIOAllowed(); 31 base::ThreadRestrictions::AssertIOAllowed();
31 return (copyfile(from_path.value().c_str(), 32 return (copyfile(from_path.value().c_str(),
32 to_path.value().c_str(), NULL, COPYFILE_ALL) == 0); 33 to_path.value().c_str(), NULL, COPYFILE_ALL) == 0);
33 } 34 }
34 35
35 } // namespace 36 } // namespace
OLDNEW
« no previous file with comments | « no previous file | base/mac/bundle_locations.mm » ('j') | base/mac/foundation_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698