| 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.h" | 5 #include "chrome/common/chrome_paths.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ | 86 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ |
| 87 const char kFilepathSinglePrefExtensions[] = | 87 const char kFilepathSinglePrefExtensions[] = |
| 88 #if defined(GOOGLE_CHROME_BUILD) | 88 #if defined(GOOGLE_CHROME_BUILD) |
| 89 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions"); | 89 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions"); |
| 90 #else | 90 #else |
| 91 FILE_PATH_LITERAL("/usr/share/chromium/extensions"); | 91 FILE_PATH_LITERAL("/usr/share/chromium/extensions"); |
| 92 #endif // defined(GOOGLE_CHROME_BUILD) | 92 #endif // defined(GOOGLE_CHROME_BUILD) |
| 93 #endif // defined(OS_LINUX) | 93 #endif // defined(OS_LINUX) |
| 94 | 94 |
| 95 #if defined(OS_CHROMEOS) | 95 #if defined(OS_CHROMEOS) |
| 96 |
| 96 const char kDefaultAppOrderFileName[] = | 97 const char kDefaultAppOrderFileName[] = |
| 97 #if defined(GOOGLE_CHROME_BUILD) | 98 #if defined(GOOGLE_CHROME_BUILD) |
| 98 FILE_PATH_LITERAL("/usr/share/google-chrome/default_app_order.json"); | 99 FILE_PATH_LITERAL("/usr/share/google-chrome/default_app_order.json"); |
| 99 #else | 100 #else |
| 100 FILE_PATH_LITERAL("/usr/share/chromium/default_app_order.json"); | 101 FILE_PATH_LITERAL("/usr/share/chromium/default_app_order.json"); |
| 101 #endif // defined(GOOGLE_CHROME_BUILD) | 102 #endif // defined(GOOGLE_CHROME_BUILD) |
| 103 |
| 104 const FilePath::CharType kDefaultUserPolicyKeysDir[] = |
| 105 FILE_PATH_LITERAL("/var/run/user_policy"); |
| 106 |
| 102 #endif // defined(OS_CHROMEOS) | 107 #endif // defined(OS_CHROMEOS) |
| 103 | 108 |
| 104 } // namespace | 109 } // namespace |
| 105 | 110 |
| 106 namespace chrome { | 111 namespace chrome { |
| 107 | 112 |
| 108 // Gets the path for internal plugins. | 113 // Gets the path for internal plugins. |
| 109 bool GetInternalPluginsDirectory(FilePath* result) { | 114 bool GetInternalPluginsDirectory(FilePath* result) { |
| 110 #if defined(OS_MACOSX) && !defined(OS_IOS) | 115 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 111 // If called from Chrome, get internal plugins from a subdirectory of the | 116 // If called from Chrome, get internal plugins from a subdirectory of the |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 cur = cur.Append(FILE_PATH_LITERAL("wallpapers")); | 398 cur = cur.Append(FILE_PATH_LITERAL("wallpapers")); |
| 394 break; | 399 break; |
| 395 case chrome::DIR_CHROMEOS_WALLPAPER_THUMBNAILS: | 400 case chrome::DIR_CHROMEOS_WALLPAPER_THUMBNAILS: |
| 396 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 401 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 397 return false; | 402 return false; |
| 398 cur = cur.Append(FILE_PATH_LITERAL("wallpaper_thumbnails")); | 403 cur = cur.Append(FILE_PATH_LITERAL("wallpaper_thumbnails")); |
| 399 break; | 404 break; |
| 400 case chrome::FILE_DEFAULT_APP_ORDER: | 405 case chrome::FILE_DEFAULT_APP_ORDER: |
| 401 cur = FilePath(FILE_PATH_LITERAL(kDefaultAppOrderFileName)); | 406 cur = FilePath(FILE_PATH_LITERAL(kDefaultAppOrderFileName)); |
| 402 break; | 407 break; |
| 408 case chrome::DIR_USER_POLICY_KEYS: |
| 409 cur = FilePath(kDefaultUserPolicyKeysDir); |
| 410 break; |
| 403 #endif | 411 #endif |
| 404 // The following are only valid in the development environment, and | 412 // The following are only valid in the development environment, and |
| 405 // will fail if executed from an installed executable (because the | 413 // will fail if executed from an installed executable (because the |
| 406 // generated path won't exist). | 414 // generated path won't exist). |
| 407 case chrome::DIR_GEN_TEST_DATA: | 415 case chrome::DIR_GEN_TEST_DATA: |
| 408 if (!PathService::Get(base::DIR_MODULE, &cur)) | 416 if (!PathService::Get(base::DIR_MODULE, &cur)) |
| 409 return false; | 417 return false; |
| 410 cur = cur.Append(FILE_PATH_LITERAL("test_data")); | 418 cur = cur.Append(FILE_PATH_LITERAL("test_data")); |
| 411 if (!file_util::PathExists(cur)) // We don't want to create this. | 419 if (!file_util::PathExists(cur)) // We don't want to create this. |
| 412 return false; | 420 return false; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 return true; | 516 return true; |
| 509 } | 517 } |
| 510 | 518 |
| 511 // This cannot be done as a static initializer sadly since Visual Studio will | 519 // This cannot be done as a static initializer sadly since Visual Studio will |
| 512 // eliminate this object file if there is no direct entry point into it. | 520 // eliminate this object file if there is no direct entry point into it. |
| 513 void RegisterPathProvider() { | 521 void RegisterPathProvider() { |
| 514 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 522 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 515 } | 523 } |
| 516 | 524 |
| 517 } // namespace chrome | 525 } // namespace chrome |
| OLD | NEW |