OLD | NEW |
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 #include "chrome/common/chrome_paths_internal.h" | 5 #include "chrome/common/chrome_paths_internal.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 // The framework bundle is at a known path and name from the browser .app's | 210 // The framework bundle is at a known path and name from the browser .app's |
211 // versioned directory. | 211 // versioned directory. |
212 return GetVersionedDirectory().Append(kFrameworkName); | 212 return GetVersionedDirectory().Append(kFrameworkName); |
213 } | 213 } |
214 | 214 |
215 bool GetLocalLibraryDirectory(base::FilePath* result) { | 215 bool GetLocalLibraryDirectory(base::FilePath* result) { |
216 return base::mac::GetLocalDirectory(NSLibraryDirectory, result); | 216 return base::mac::GetLocalDirectory(NSLibraryDirectory, result); |
217 } | 217 } |
218 | 218 |
219 bool GetUserLibraryDirectory(base::FilePath* result) { | |
220 return base::mac::GetUserDirectory(NSLibraryDirectory, result); | |
221 } | |
222 | |
223 bool GetUserApplicationsDirectory(base::FilePath* result) { | |
224 return base::mac::GetUserDirectory(NSApplicationDirectory, result); | |
225 } | |
226 | |
227 bool GetGlobalApplicationSupportDirectory(base::FilePath* result) { | 219 bool GetGlobalApplicationSupportDirectory(base::FilePath* result) { |
228 return base::mac::GetLocalDirectory(NSApplicationSupportDirectory, result); | 220 return base::mac::GetLocalDirectory(NSApplicationSupportDirectory, result); |
229 } | 221 } |
230 | 222 |
231 NSBundle* OuterAppBundle() { | 223 NSBundle* OuterAppBundle() { |
232 // Cache this. Foundation leaks it anyway, and this should be the only call | 224 // Cache this. Foundation leaks it anyway, and this should be the only call |
233 // to OuterAppBundleInternal(). | 225 // to OuterAppBundleInternal(). |
234 static NSBundle* bundle = OuterAppBundleInternal(); | 226 static NSBundle* bundle = OuterAppBundleInternal(); |
235 return bundle; | 227 return bundle; |
236 } | 228 } |
237 | 229 |
238 bool GetUserDataDirectoryForBrowserBundle(NSBundle* bundle, | 230 bool GetUserDataDirectoryForBrowserBundle(NSBundle* bundle, |
239 base::FilePath* result) { | 231 base::FilePath* result) { |
240 scoped_ptr<char, base::FreeDeleter> | 232 scoped_ptr<char, base::FreeDeleter> |
241 product_dir_name(ProductDirNameForBundle(bundle)); | 233 product_dir_name(ProductDirNameForBundle(bundle)); |
242 return GetDefaultUserDataDirectoryForProduct(product_dir_name.get(), result); | 234 return GetDefaultUserDataDirectoryForProduct(product_dir_name.get(), result); |
243 } | 235 } |
244 | 236 |
245 #endif // !defined(OS_IOS) | 237 #endif // !defined(OS_IOS) |
246 | 238 |
247 bool ProcessNeedsProfileDir(const std::string& process_type) { | 239 bool ProcessNeedsProfileDir(const std::string& process_type) { |
248 // For now we have no reason to forbid this on other MacOS as we don't | 240 // For now we have no reason to forbid this on other MacOS as we don't |
249 // have the roaming profile troubles there. | 241 // have the roaming profile troubles there. |
250 return true; | 242 return true; |
251 } | 243 } |
252 | 244 |
253 } // namespace chrome | 245 } // namespace chrome |
OLD | NEW |