Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chrome/common/chrome_paths.cc

Issue 2409423002: Move ENABLE_PEPPER_CDMS to a buildflag header. (Closed)
Patch Set: Fix and format Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/chrome_content_client.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 cur = cur.DirName(); 364 cur = cur.DirName();
364 cur = cur.DirName(); 365 cur = cur.DirName();
365 cur = cur.DirName(); 366 cur = cur.DirName();
366 } 367 }
367 #else 368 #else
368 if (!GetInternalPluginsDirectory(&cur)) 369 if (!GetInternalPluginsDirectory(&cur))
369 return false; 370 return false;
370 #endif 371 #endif
371 cur = cur.Append(FILE_PATH_LITERAL("pnacl")); 372 cur = cur.Append(FILE_PATH_LITERAL("pnacl"));
372 break; 373 break;
373 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) 374 #if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
374 #if defined(WIDEVINE_CDM_IS_COMPONENT) 375 #if defined(WIDEVINE_CDM_IS_COMPONENT)
375 case chrome::DIR_COMPONENT_WIDEVINE_CDM: 376 case chrome::DIR_COMPONENT_WIDEVINE_CDM:
376 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) 377 if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
377 return false; 378 return false;
378 cur = cur.AppendASCII(kWidevineCdmBaseDirectory); 379 cur = cur.AppendASCII(kWidevineCdmBaseDirectory);
379 break; 380 break;
380 #endif // defined(WIDEVINE_CDM_IS_COMPONENT) 381 #endif // defined(WIDEVINE_CDM_IS_COMPONENT)
381 // TODO(xhwang): FILE_WIDEVINE_CDM_ADAPTER has different meanings. 382 // TODO(xhwang): FILE_WIDEVINE_CDM_ADAPTER has different meanings.
382 // In the component case, this is the source adapter. Otherwise, it is the 383 // In the component case, this is the source adapter. Otherwise, it is the
383 // actual Pepper module that gets loaded. 384 // actual Pepper module that gets loaded.
384 case chrome::FILE_WIDEVINE_CDM_ADAPTER: 385 case chrome::FILE_WIDEVINE_CDM_ADAPTER:
385 if (!GetComponentDirectory(&cur)) 386 if (!GetComponentDirectory(&cur))
386 return false; 387 return false;
387 cur = cur.Append( 388 cur = cur.Append(
388 media::GetPlatformSpecificDirectory(kWidevineCdmBaseDirectory)); 389 media::GetPlatformSpecificDirectory(kWidevineCdmBaseDirectory));
389 cur = cur.AppendASCII(kWidevineCdmAdapterFileName); 390 cur = cur.AppendASCII(kWidevineCdmAdapterFileName);
390 break; 391 break;
391 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) 392 #endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
392 case chrome::FILE_RESOURCES_PACK: 393 case chrome::FILE_RESOURCES_PACK:
393 #if defined(OS_MACOSX) 394 #if defined(OS_MACOSX)
394 cur = base::mac::FrameworkBundlePath(); 395 cur = base::mac::FrameworkBundlePath();
395 cur = cur.Append(FILE_PATH_LITERAL("Resources")) 396 cur = cur.Append(FILE_PATH_LITERAL("Resources"))
396 .Append(FILE_PATH_LITERAL("resources.pak")); 397 .Append(FILE_PATH_LITERAL("resources.pak"));
397 break; 398 break;
398 #elif defined(OS_ANDROID) 399 #elif defined(OS_ANDROID)
399 if (!PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &cur)) 400 if (!PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &cur))
400 return false; 401 return false;
401 #else 402 #else
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 605
605 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { 606 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) {
606 g_invalid_specified_user_data_dir.Get() = user_data_dir; 607 g_invalid_specified_user_data_dir.Get() = user_data_dir;
607 } 608 }
608 609
609 const base::FilePath& GetInvalidSpecifiedUserDataDir() { 610 const base::FilePath& GetInvalidSpecifiedUserDataDir() {
610 return g_invalid_specified_user_data_dir.Get(); 611 return g_invalid_specified_user_data_dir.Get();
611 } 612 }
612 613
613 } // namespace chrome 614 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_content_client.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698