| 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/files/file_util.h" | 7 #include "base/files/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" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/sys_info.h" | 13 #include "base/sys_info.h" |
| 14 #include "base/threading/thread_restrictions.h" | 14 #include "base/threading/thread_restrictions.h" |
| 15 #include "base/version.h" | 15 #include "base/version.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
| 18 #include "chrome/common/chrome_paths_internal.h" | 18 #include "chrome/common/chrome_paths_internal.h" |
| 19 #include "media/cdm/cdm_paths.h" |
| 19 | 20 |
| 20 #if defined(OS_ANDROID) | 21 #if defined(OS_ANDROID) |
| 21 #include "base/android/path_utils.h" | 22 #include "base/android/path_utils.h" |
| 22 #include "base/base_paths_android.h" | 23 #include "base/base_paths_android.h" |
| 23 // ui/base must only be used on Android. See BUILD.gn for dependency info. | 24 // ui/base must only be used on Android. See BUILD.gn for dependency info. |
| 24 #include "ui/base/ui_base_paths.h" // nogncheck | 25 #include "ui/base/ui_base_paths.h" // nogncheck |
| 25 #endif | 26 #endif |
| 26 | 27 |
| 27 #if defined(OS_MACOSX) | 28 #if defined(OS_MACOSX) |
| 28 #include "base/mac/foundation_util.h" | 29 #include "base/mac/foundation_util.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 if (!GetInternalPluginsDirectory(&cur)) | 362 if (!GetInternalPluginsDirectory(&cur)) |
| 362 return false; | 363 return false; |
| 363 #endif | 364 #endif |
| 364 cur = cur.Append(FILE_PATH_LITERAL("pnacl")); | 365 cur = cur.Append(FILE_PATH_LITERAL("pnacl")); |
| 365 break; | 366 break; |
| 366 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) | 367 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) |
| 367 #if defined(WIDEVINE_CDM_IS_COMPONENT) | 368 #if defined(WIDEVINE_CDM_IS_COMPONENT) |
| 368 case chrome::DIR_COMPONENT_WIDEVINE_CDM: | 369 case chrome::DIR_COMPONENT_WIDEVINE_CDM: |
| 369 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 370 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 370 return false; | 371 return false; |
| 371 cur = cur.Append(FILE_PATH_LITERAL("WidevineCDM")); | 372 cur = cur.AppendASCII(kWidevineCdmBaseDirectory); |
| 372 break; | 373 break; |
| 373 #endif // defined(WIDEVINE_CDM_IS_COMPONENT) | 374 #endif // defined(WIDEVINE_CDM_IS_COMPONENT) |
| 374 // TODO(xhwang): FILE_WIDEVINE_CDM_ADAPTER has different meanings. | 375 // TODO(xhwang): FILE_WIDEVINE_CDM_ADAPTER has different meanings. |
| 375 // In the component case, this is the source adapter. Otherwise, it is the | 376 // In the component case, this is the source adapter. Otherwise, it is the |
| 376 // actual Pepper module that gets loaded. | 377 // actual Pepper module that gets loaded. |
| 377 case chrome::FILE_WIDEVINE_CDM_ADAPTER: | 378 case chrome::FILE_WIDEVINE_CDM_ADAPTER: |
| 378 if (!GetComponentDirectory(&cur)) | 379 if (!GetComponentDirectory(&cur)) |
| 379 return false; | 380 return false; |
| 381 cur = cur.Append( |
| 382 media::GetPlatformSpecificDirectory(kWidevineCdmBaseDirectory)); |
| 380 cur = cur.AppendASCII(kWidevineCdmAdapterFileName); | 383 cur = cur.AppendASCII(kWidevineCdmAdapterFileName); |
| 381 break; | 384 break; |
| 382 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) | 385 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) |
| 383 case chrome::FILE_RESOURCES_PACK: | 386 case chrome::FILE_RESOURCES_PACK: |
| 384 #if defined(OS_MACOSX) | 387 #if defined(OS_MACOSX) |
| 385 cur = base::mac::FrameworkBundlePath(); | 388 cur = base::mac::FrameworkBundlePath(); |
| 386 cur = cur.Append(FILE_PATH_LITERAL("Resources")) | 389 cur = cur.Append(FILE_PATH_LITERAL("Resources")) |
| 387 .Append(FILE_PATH_LITERAL("resources.pak")); | 390 .Append(FILE_PATH_LITERAL("resources.pak")); |
| 388 break; | 391 break; |
| 389 #elif defined(OS_ANDROID) | 392 #elif defined(OS_ANDROID) |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 | 592 |
| 590 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 593 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
| 591 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 594 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
| 592 } | 595 } |
| 593 | 596 |
| 594 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 597 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
| 595 return g_invalid_specified_user_data_dir.Get(); | 598 return g_invalid_specified_user_data_dir.Get(); |
| 596 } | 599 } |
| 597 | 600 |
| 598 } // namespace chrome | 601 } // namespace chrome |
| OLD | NEW |