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