OLD | NEW |
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2010 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.h" | 5 #include "chrome/common/chrome_paths.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 break; | 276 break; |
277 case chrome::DIR_TEST_TOOLS: | 277 case chrome::DIR_TEST_TOOLS: |
278 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) | 278 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) |
279 return false; | 279 return false; |
280 cur = cur.Append(FILE_PATH_LITERAL("chrome")); | 280 cur = cur.Append(FILE_PATH_LITERAL("chrome")); |
281 cur = cur.Append(FILE_PATH_LITERAL("tools")); | 281 cur = cur.Append(FILE_PATH_LITERAL("tools")); |
282 cur = cur.Append(FILE_PATH_LITERAL("test")); | 282 cur = cur.Append(FILE_PATH_LITERAL("test")); |
283 if (!file_util::PathExists(cur)) // we don't want to create this | 283 if (!file_util::PathExists(cur)) // we don't want to create this |
284 return false; | 284 return false; |
285 break; | 285 break; |
| 286 #if !defined(OS_MACOSX) && defined(OS_POSIX) |
| 287 case chrome::DIR_POLICY_FILES: { |
| 288 #if defined(GOOGLE_CHROME_BUILD) |
| 289 cur = FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies")); |
| 290 #else |
| 291 cur = FilePath(FILE_PATH_LITERAL("/etc/chromium/policies")); |
| 292 #endif |
| 293 if (!file_util::PathExists(cur)) // we don't want to create this |
| 294 return false; |
| 295 break; |
| 296 } |
| 297 #endif |
286 default: | 298 default: |
287 return false; | 299 return false; |
288 } | 300 } |
289 | 301 |
290 if (create_dir && !file_util::PathExists(cur) && | 302 if (create_dir && !file_util::PathExists(cur) && |
291 !file_util::CreateDirectory(cur)) | 303 !file_util::CreateDirectory(cur)) |
292 return false; | 304 return false; |
293 | 305 |
294 *result = cur; | 306 *result = cur; |
295 return true; | 307 return true; |
296 } | 308 } |
297 | 309 |
298 // This cannot be done as a static initializer sadly since Visual Studio will | 310 // This cannot be done as a static initializer sadly since Visual Studio will |
299 // eliminate this object file if there is no direct entry point into it. | 311 // eliminate this object file if there is no direct entry point into it. |
300 void RegisterPathProvider() { | 312 void RegisterPathProvider() { |
301 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 313 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
302 } | 314 } |
303 | 315 |
304 } // namespace chrome | 316 } // namespace chrome |
OLD | NEW |