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> |
11 | 11 |
12 #include "base/base_paths.h" | 12 #include "base/base_paths.h" |
| 13 #include "base/base_paths_posix.h" |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #import "base/mac/foundation_util.h" | 15 #import "base/mac/foundation_util.h" |
15 #import "base/mac/mac_util.h" | 16 #import "base/mac/mac_util.h" |
16 #import "base/mac/scoped_nsautorelease_pool.h" | 17 #import "base/mac/scoped_nsautorelease_pool.h" |
17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
18 #include "chrome/common/chrome_constants.h" | 19 #include "chrome/common/chrome_constants.h" |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 const FilePath* g_override_versioned_directory = NULL; | 23 const FilePath* g_override_versioned_directory = NULL; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 141 } |
141 | 142 |
142 bool GetUserPicturesDirectory(FilePath* result) { | 143 bool GetUserPicturesDirectory(FilePath* result) { |
143 return base::mac::GetUserDirectory(NSPicturesDirectory, result); | 144 return base::mac::GetUserDirectory(NSPicturesDirectory, result); |
144 } | 145 } |
145 | 146 |
146 bool GetUserVideosDirectory(FilePath* result) { | 147 bool GetUserVideosDirectory(FilePath* result) { |
147 return base::mac::GetUserDirectory(NSMoviesDirectory, result); | 148 return base::mac::GetUserDirectory(NSMoviesDirectory, result); |
148 } | 149 } |
149 | 150 |
150 bool GetUserDesktop(FilePath* result) { | |
151 return base::mac::GetUserDirectory(NSDesktopDirectory, result); | |
152 } | |
153 | |
154 FilePath GetVersionedDirectory() { | 151 FilePath GetVersionedDirectory() { |
155 if (g_override_versioned_directory) | 152 if (g_override_versioned_directory) |
156 return *g_override_versioned_directory; | 153 return *g_override_versioned_directory; |
157 | 154 |
158 // Start out with the path to the running executable. | 155 // Start out with the path to the running executable. |
159 FilePath path; | 156 FilePath path; |
160 PathService::Get(base::FILE_EXE, &path); | 157 PathService::Get(base::FILE_EXE, &path); |
161 | 158 |
162 // One step up to MacOS, another to Contents. | 159 // One step up to MacOS, another to Contents. |
163 path = path.DirName().DirName(); | 160 path = path.DirName().DirName(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 return bundle; | 208 return bundle; |
212 } | 209 } |
213 | 210 |
214 bool ProcessNeedsProfileDir(const std::string& process_type) { | 211 bool ProcessNeedsProfileDir(const std::string& process_type) { |
215 // For now we have no reason to forbid this on other MacOS as we don't | 212 // For now we have no reason to forbid this on other MacOS as we don't |
216 // have the roaming profile troubles there. | 213 // have the roaming profile troubles there. |
217 return true; | 214 return true; |
218 } | 215 } |
219 | 216 |
220 } // namespace chrome | 217 } // namespace chrome |
OLD | NEW |