| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 FILE_PATH_LITERAL("pepper/libppo3dautoplugin.so"); | 77 FILE_PATH_LITERAL("pepper/libppo3dautoplugin.so"); |
| 78 | 78 |
| 79 const base::FilePath::CharType kGTalkPluginFileName[] = | 79 const base::FilePath::CharType kGTalkPluginFileName[] = |
| 80 FILE_PATH_LITERAL("pepper/libppgoogletalk.so"); | 80 FILE_PATH_LITERAL("pepper/libppgoogletalk.so"); |
| 81 | 81 |
| 82 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 82 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| 83 | 83 |
| 84 #if defined(OS_LINUX) | 84 #if defined(OS_LINUX) |
| 85 // The path to the external extension <id>.json files. | 85 // The path to the external extension <id>.json files. |
| 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 base::FilePath::CharType 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 const char kDefaultAppOrderFileName[] = | 96 const base::FilePath::CharType kDefaultAppOrderFileName[] = |
| 97 #if defined(GOOGLE_CHROME_BUILD) | 97 #if defined(GOOGLE_CHROME_BUILD) |
| 98 FILE_PATH_LITERAL("/usr/share/google-chrome/default_app_order.json"); | 98 FILE_PATH_LITERAL("/usr/share/google-chrome/default_app_order.json"); |
| 99 #else | 99 #else |
| 100 FILE_PATH_LITERAL("/usr/share/chromium/default_app_order.json"); | 100 FILE_PATH_LITERAL("/usr/share/chromium/default_app_order.json"); |
| 101 #endif // defined(GOOGLE_CHROME_BUILD) | 101 #endif // defined(GOOGLE_CHROME_BUILD) |
| 102 #endif // defined(OS_CHROMEOS) | 102 #endif // defined(OS_CHROMEOS) |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| 105 | 105 |
| 106 namespace chrome { | 106 namespace chrome { |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 396 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 397 return false; | 397 return false; |
| 398 cur = cur.Append(FILE_PATH_LITERAL("wallpaper_thumbnails")); | 398 cur = cur.Append(FILE_PATH_LITERAL("wallpaper_thumbnails")); |
| 399 break; | 399 break; |
| 400 case chrome::DIR_CHROMEOS_CUSTOM_WALLPAPERS: | 400 case chrome::DIR_CHROMEOS_CUSTOM_WALLPAPERS: |
| 401 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 401 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 402 return false; | 402 return false; |
| 403 cur = cur.Append(FILE_PATH_LITERAL("custom_wallpapers")); | 403 cur = cur.Append(FILE_PATH_LITERAL("custom_wallpapers")); |
| 404 break; | 404 break; |
| 405 case chrome::FILE_DEFAULT_APP_ORDER: | 405 case chrome::FILE_DEFAULT_APP_ORDER: |
| 406 cur = base::FilePath(FILE_PATH_LITERAL(kDefaultAppOrderFileName)); | 406 cur = base::FilePath(kDefaultAppOrderFileName); |
| 407 break; | 407 break; |
| 408 #endif | 408 #endif |
| 409 // The following are only valid in the development environment, and | 409 // The following are only valid in the development environment, and |
| 410 // will fail if executed from an installed executable (because the | 410 // will fail if executed from an installed executable (because the |
| 411 // generated path won't exist). | 411 // generated path won't exist). |
| 412 case chrome::DIR_GEN_TEST_DATA: | 412 case chrome::DIR_GEN_TEST_DATA: |
| 413 if (!PathService::Get(base::DIR_MODULE, &cur)) | 413 if (!PathService::Get(base::DIR_MODULE, &cur)) |
| 414 return false; | 414 return false; |
| 415 cur = cur.Append(FILE_PATH_LITERAL("test_data")); | 415 cur = cur.Append(FILE_PATH_LITERAL("test_data")); |
| 416 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. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 #if defined(OS_CHROMEOS) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 461 #if defined(OS_CHROMEOS) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
| 462 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { | 462 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { |
| 463 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 463 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 464 return false; | 464 return false; |
| 465 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); | 465 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); |
| 466 break; | 466 break; |
| 467 } | 467 } |
| 468 #endif | 468 #endif |
| 469 #if defined(OS_LINUX) | 469 #if defined(OS_LINUX) |
| 470 case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: { | 470 case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: { |
| 471 cur = base::FilePath(FILE_PATH_LITERAL(kFilepathSinglePrefExtensions)); | 471 cur = base::FilePath(kFilepathSinglePrefExtensions); |
| 472 break; | 472 break; |
| 473 } | 473 } |
| 474 #endif | 474 #endif |
| 475 case chrome::DIR_EXTERNAL_EXTENSIONS: | 475 case chrome::DIR_EXTERNAL_EXTENSIONS: |
| 476 #if defined(OS_MACOSX) && !defined(OS_IOS) | 476 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 477 if (!chrome::GetGlobalApplicationSupportDirectory(&cur)) | 477 if (!chrome::GetGlobalApplicationSupportDirectory(&cur)) |
| 478 return false; | 478 return false; |
| 479 | 479 |
| 480 cur = cur.Append(FILE_PATH_LITERAL("Google")) | 480 cur = cur.Append(FILE_PATH_LITERAL("Google")) |
| 481 .Append(FILE_PATH_LITERAL("Chrome")) | 481 .Append(FILE_PATH_LITERAL("Chrome")) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 return true; | 513 return true; |
| 514 } | 514 } |
| 515 | 515 |
| 516 // 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 |
| 517 // 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. |
| 518 void RegisterPathProvider() { | 518 void RegisterPathProvider() { |
| 519 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 519 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 520 } | 520 } |
| 521 | 521 |
| 522 } // namespace chrome | 522 } // namespace chrome |
| OLD | NEW |