| 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/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // The path to the external extension <id>.json files. | 93 // The path to the external extension <id>.json files. |
| 94 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ | 94 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ |
| 95 const base::FilePath::CharType kFilepathSinglePrefExtensions[] = | 95 const base::FilePath::CharType kFilepathSinglePrefExtensions[] = |
| 96 #if defined(GOOGLE_CHROME_BUILD) | 96 #if defined(GOOGLE_CHROME_BUILD) |
| 97 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions"); | 97 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions"); |
| 98 #else | 98 #else |
| 99 FILE_PATH_LITERAL("/usr/share/chromium/extensions"); | 99 FILE_PATH_LITERAL("/usr/share/chromium/extensions"); |
| 100 #endif // defined(GOOGLE_CHROME_BUILD) | 100 #endif // defined(GOOGLE_CHROME_BUILD) |
| 101 #endif // defined(OS_LINUX) | 101 #endif // defined(OS_LINUX) |
| 102 | 102 |
| 103 const base::FilePath::CharType kRecoveryComponentInstallerDir[] = |
| 104 FILE_PATH_LITERAL("recovery/installer"); |
| 105 |
| 103 static base::LazyInstance<base::FilePath> | 106 static base::LazyInstance<base::FilePath> |
| 104 g_invalid_specified_user_data_dir = LAZY_INSTANCE_INITIALIZER; | 107 g_invalid_specified_user_data_dir = LAZY_INSTANCE_INITIALIZER; |
| 105 | 108 |
| 106 // Gets the path for internal plugins. | 109 // Gets the path for internal plugins. |
| 107 bool GetInternalPluginsDirectory(base::FilePath* result) { | 110 bool GetInternalPluginsDirectory(base::FilePath* result) { |
| 108 #if defined(OS_MACOSX) && !defined(OS_IOS) | 111 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 109 // If called from Chrome, get internal plugins from a subdirectory of the | 112 // If called from Chrome, get internal plugins from a subdirectory of the |
| 110 // framework. | 113 // framework. |
| 111 if (base::mac::AmIBundled()) { | 114 if (base::mac::AmIBundled()) { |
| 112 *result = chrome::GetFrameworkBundlePath(); | 115 *result = chrome::GetFrameworkBundlePath(); |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 #endif // defined(WIDEVINE_CDM_IS_COMPONENT) | 388 #endif // defined(WIDEVINE_CDM_IS_COMPONENT) |
| 386 // TODO(xhwang): FILE_WIDEVINE_CDM_ADAPTER has different meanings. | 389 // TODO(xhwang): FILE_WIDEVINE_CDM_ADAPTER has different meanings. |
| 387 // In the component case, this is the source adapter. Otherwise, it is the | 390 // In the component case, this is the source adapter. Otherwise, it is the |
| 388 // actual Pepper module that gets loaded. | 391 // actual Pepper module that gets loaded. |
| 389 case chrome::FILE_WIDEVINE_CDM_ADAPTER: | 392 case chrome::FILE_WIDEVINE_CDM_ADAPTER: |
| 390 if (!GetInternalPluginsDirectory(&cur)) | 393 if (!GetInternalPluginsDirectory(&cur)) |
| 391 return false; | 394 return false; |
| 392 cur = cur.AppendASCII(kWidevineCdmAdapterFileName); | 395 cur = cur.AppendASCII(kWidevineCdmAdapterFileName); |
| 393 break; | 396 break; |
| 394 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) | 397 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) |
| 398 |
| 399 case chrome::DIR_RECOVERY_COMPONENT_INSTALLER: |
| 400 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 401 return false; |
| 402 cur = cur.Append(kRecoveryComponentInstallerDir); |
| 403 break; |
| 404 |
| 395 case chrome::FILE_RESOURCES_PACK: | 405 case chrome::FILE_RESOURCES_PACK: |
| 396 #if defined(OS_MACOSX) && !defined(OS_IOS) | 406 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 397 if (base::mac::AmIBundled()) { | 407 if (base::mac::AmIBundled()) { |
| 398 cur = base::mac::FrameworkBundlePath(); | 408 cur = base::mac::FrameworkBundlePath(); |
| 399 cur = cur.Append(FILE_PATH_LITERAL("Resources")) | 409 cur = cur.Append(FILE_PATH_LITERAL("Resources")) |
| 400 .Append(FILE_PATH_LITERAL("resources.pak")); | 410 .Append(FILE_PATH_LITERAL("resources.pak")); |
| 401 break; | 411 break; |
| 402 } | 412 } |
| 403 #elif defined(OS_ANDROID) | 413 #elif defined(OS_ANDROID) |
| 404 if (!PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &cur)) | 414 if (!PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &cur)) |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 | 617 |
| 608 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 618 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
| 609 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 619 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
| 610 } | 620 } |
| 611 | 621 |
| 612 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 622 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
| 613 return g_invalid_specified_user_data_dir.Get(); | 623 return g_invalid_specified_user_data_dir.Get(); |
| 614 } | 624 } |
| 615 | 625 |
| 616 } // namespace chrome | 626 } // namespace chrome |
| OLD | NEW |