| 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 | |
| 97 const char kDefaultAppOrderFileName[] = | 96 const char kDefaultAppOrderFileName[] = |
| 98 #if defined(GOOGLE_CHROME_BUILD) | 97 #if defined(GOOGLE_CHROME_BUILD) |
| 99 FILE_PATH_LITERAL("/usr/share/google-chrome/default_app_order.json"); | 98 FILE_PATH_LITERAL("/usr/share/google-chrome/default_app_order.json"); |
| 100 #else | 99 #else |
| 101 FILE_PATH_LITERAL("/usr/share/chromium/default_app_order.json"); | 100 FILE_PATH_LITERAL("/usr/share/chromium/default_app_order.json"); |
| 102 #endif // defined(GOOGLE_CHROME_BUILD) | 101 #endif // defined(GOOGLE_CHROME_BUILD) |
| 103 | |
| 104 const FilePath::CharType kDefaultUserPolicyKeysDir[] = | |
| 105 FILE_PATH_LITERAL("/var/run/user_policy"); | |
| 106 | |
| 107 #endif // defined(OS_CHROMEOS) | 102 #endif // defined(OS_CHROMEOS) |
| 108 | 103 |
| 109 } // namespace | 104 } // namespace |
| 110 | 105 |
| 111 namespace chrome { | 106 namespace chrome { |
| 112 | 107 |
| 113 // Gets the path for internal plugins. | 108 // Gets the path for internal plugins. |
| 114 bool GetInternalPluginsDirectory(base::FilePath* result) { | 109 bool GetInternalPluginsDirectory(base::FilePath* result) { |
| 115 #if defined(OS_MACOSX) && !defined(OS_IOS) | 110 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 116 // If called from Chrome, get internal plugins from a subdirectory of the | 111 // If called from Chrome, get internal plugins from a subdirectory of the |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 cur = cur.Append(FILE_PATH_LITERAL("wallpaper_thumbnails")); | 398 cur = cur.Append(FILE_PATH_LITERAL("wallpaper_thumbnails")); |
| 404 break; | 399 break; |
| 405 case chrome::DIR_CHROMEOS_CUSTOM_WALLPAPERS: | 400 case chrome::DIR_CHROMEOS_CUSTOM_WALLPAPERS: |
| 406 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 401 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 407 return false; | 402 return false; |
| 408 cur = cur.Append(FILE_PATH_LITERAL("custom_wallpapers")); | 403 cur = cur.Append(FILE_PATH_LITERAL("custom_wallpapers")); |
| 409 break; | 404 break; |
| 410 case chrome::FILE_DEFAULT_APP_ORDER: | 405 case chrome::FILE_DEFAULT_APP_ORDER: |
| 411 cur = base::FilePath(FILE_PATH_LITERAL(kDefaultAppOrderFileName)); | 406 cur = base::FilePath(FILE_PATH_LITERAL(kDefaultAppOrderFileName)); |
| 412 break; | 407 break; |
| 413 case chrome::DIR_USER_POLICY_KEYS: | |
| 414 cur = FilePath(kDefaultUserPolicyKeysDir); | |
| 415 break; | |
| 416 #endif | 408 #endif |
| 417 // The following are only valid in the development environment, and | 409 // The following are only valid in the development environment, and |
| 418 // will fail if executed from an installed executable (because the | 410 // will fail if executed from an installed executable (because the |
| 419 // generated path won't exist). | 411 // generated path won't exist). |
| 420 case chrome::DIR_GEN_TEST_DATA: | 412 case chrome::DIR_GEN_TEST_DATA: |
| 421 if (!PathService::Get(base::DIR_MODULE, &cur)) | 413 if (!PathService::Get(base::DIR_MODULE, &cur)) |
| 422 return false; | 414 return false; |
| 423 cur = cur.Append(FILE_PATH_LITERAL("test_data")); | 415 cur = cur.Append(FILE_PATH_LITERAL("test_data")); |
| 424 if (!file_util::PathExists(cur)) // We don't want to create this. | 416 if (!file_util::PathExists(cur)) // We don't want to create this. |
| 425 return false; | 417 return false; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 return true; | 513 return true; |
| 522 } | 514 } |
| 523 | 515 |
| 524 // This cannot be done as a static initializer sadly since Visual Studio will | 516 // This cannot be done as a static initializer sadly since Visual Studio will |
| 525 // eliminate this object file if there is no direct entry point into it. | 517 // eliminate this object file if there is no direct entry point into it. |
| 526 void RegisterPathProvider() { | 518 void RegisterPathProvider() { |
| 527 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 519 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 528 } | 520 } |
| 529 | 521 |
| 530 } // namespace chrome | 522 } // namespace chrome |
| OLD | NEW |