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