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

Side by Side Diff: base/base_paths_mac.mm

Issue 10970019: Fix PathServiceTest.Get on iOS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Return false on iOS. Created 8 years, 3 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
« no previous file with comments | « no previous file | base/path_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Defines base::PathProviderMac which replaces base::PathProviderPosix for Mac 5 // Defines base::PathProviderMac which replaces base::PathProviderPosix for Mac
6 // in base/path_service.cc. 6 // in base/path_service.cc.
7 7
8 #include <dlfcn.h> 8 #include <dlfcn.h>
9 #import <Foundation/Foundation.h> 9 #import <Foundation/Foundation.h>
10 #include <mach-o/dyld.h> 10 #include <mach-o/dyld.h>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // src/xcodebuild/{Debug|Release}/Chromium.app/Contents/MacOS/Chromium 85 // src/xcodebuild/{Debug|Release}/Chromium.app/Contents/MacOS/Chromium
86 *result = result->DirName().DirName().DirName().DirName().DirName(); 86 *result = result->DirName().DirName().DirName().DirName().DirName();
87 } else { 87 } else {
88 // Unit tests execute two levels deep from the source root, eg: 88 // Unit tests execute two levels deep from the source root, eg:
89 // src/xcodebuild/{Debug|Release}/base_unittests 89 // src/xcodebuild/{Debug|Release}/base_unittests
90 *result = result->DirName().DirName(); 90 *result = result->DirName().DirName();
91 } 91 }
92 #endif 92 #endif
93 return true; 93 return true;
94 case base::DIR_USER_DESKTOP: 94 case base::DIR_USER_DESKTOP:
95 #if defined(OS_IOS)
96 // iOS does not have desktop directories.
97 NOTIMPLEMENTED();
98 return false;
99 #else
95 return base::mac::GetUserDirectory(NSDesktopDirectory, result); 100 return base::mac::GetUserDirectory(NSDesktopDirectory, result);
101 #endif
96 case base::DIR_CACHE: 102 case base::DIR_CACHE:
97 return base::mac::GetUserDirectory(NSCachesDirectory, result); 103 return base::mac::GetUserDirectory(NSCachesDirectory, result);
98 case base::DIR_HOME: 104 case base::DIR_HOME:
99 *result = base::mac::NSStringToFilePath(NSHomeDirectory()); 105 *result = base::mac::NSStringToFilePath(NSHomeDirectory());
100 return true; 106 return true;
101 default: 107 default:
102 return false; 108 return false;
103 } 109 }
104 } 110 }
105 111
106 } // namespace base 112 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/path_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698