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_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <map> | |
Will Harris
2016/08/26 22:52:35
unneeded?
waffles
2016/08/26 23:10:04
Same deal, used on 501, decided to include it whil
| |
9 #include <memory> | 10 #include <memory> |
10 #include <tuple> | 11 #include <tuple> |
11 | 12 |
12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
13 #include "base/debug/crash_logging.h" | 14 #include "base/debug/crash_logging.h" |
14 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
15 #include "base/json/json_reader.h" | 16 #include "base/json/json_reader.h" |
16 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
17 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
18 #include "base/native_library.h" | 19 #include "base/native_library.h" |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
544 #endif // defined(OS_CHROMEOS) | 545 #endif // defined(OS_CHROMEOS) |
545 | 546 |
546 std::unique_ptr<content::PepperPluginInfo> system_flash( | 547 std::unique_ptr<content::PepperPluginInfo> system_flash( |
547 new content::PepperPluginInfo); | 548 new content::PepperPluginInfo); |
548 if (GetSystemPepperFlash(system_flash.get())) | 549 if (GetSystemPepperFlash(system_flash.get())) |
549 flash_versions.push_back(system_flash.release()); | 550 flash_versions.push_back(system_flash.release()); |
550 | 551 |
551 // This function will return only the most recent version of the flash plugin. | 552 // This function will return only the most recent version of the flash plugin. |
552 content::PepperPluginInfo* max_flash = | 553 content::PepperPluginInfo* max_flash = |
553 FindMostRecentPlugin(flash_versions.get()); | 554 FindMostRecentPlugin(flash_versions.get()); |
554 if (max_flash) | 555 if (max_flash) { |
555 plugins->push_back(*max_flash); | 556 plugins->push_back(*max_flash); |
557 } else { | |
558 #if defined(GOOGLE_CHROME_BUILD) && defined(FLAPPER_AVAILABLE) | |
559 // Add a fake Flash plugin even though it doesn't actually exist - if a | |
560 // web page requests it, it will be component-updated on-demand. There is | |
561 // nothing that guarantees the component update will give us the | |
562 // FLAPPER_VERSION_STRING version of Flash, but using this version seems | |
563 // better than any other hardcoded alternative. | |
564 plugins->push_back(CreatePepperFlashInfo( | |
565 base::FilePath::FromUTF8Unsafe(ChromeContentClient::kNotPresent), | |
566 FLAPPER_VERSION_STRING, false, false, true)); | |
567 #endif // defined(GOOGLE_CHROME_BUILD) && defined(FLAPPER_AVAILABLE) | |
568 } | |
556 #endif // defined(ENABLE_PLUGINS) | 569 #endif // defined(ENABLE_PLUGINS) |
557 } | 570 } |
558 | 571 |
559 void ChromeContentClient::AddContentDecryptionModules( | 572 void ChromeContentClient::AddContentDecryptionModules( |
560 std::vector<content::CdmInfo>* cdms) { | 573 std::vector<content::CdmInfo>* cdms) { |
561 // TODO(jrummell): Need to have a better flag to indicate systems Widevine | 574 // TODO(jrummell): Need to have a better flag to indicate systems Widevine |
562 // is available on. For now we continue to use ENABLE_PEPPER_CDMS so that | 575 // is available on. For now we continue to use ENABLE_PEPPER_CDMS so that |
563 // we can experiment between pepper and mojo. | 576 // we can experiment between pepper and mojo. |
564 #if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) | 577 #if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) |
565 base::FilePath adapter_path; | 578 base::FilePath adapter_path; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
717 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy()); | 730 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy()); |
718 } | 731 } |
719 return origin_trial_policy_.get(); | 732 return origin_trial_policy_.get(); |
720 } | 733 } |
721 | 734 |
722 #if defined(OS_ANDROID) | 735 #if defined(OS_ANDROID) |
723 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 736 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
724 return new ChromeMediaClientAndroid(); | 737 return new ChromeMediaClientAndroid(); |
725 } | 738 } |
726 #endif // OS_ANDROID | 739 #endif // OS_ANDROID |
OLD | NEW |