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