| 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> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <tuple> | 11 #include <tuple> |
| 12 | 12 |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/debug/crash_logging.h" | 14 #include "base/debug/crash_logging.h" |
| 15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 16 #include "base/json/json_reader.h" | 16 #include "base/json/json_reader.h" |
| 17 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
| 18 #include "base/native_library.h" | 18 #include "base/native_library.h" |
| 19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 20 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 22 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
| 23 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
| 24 #include "base/strings/stringprintf.h" | 24 #include "base/strings/stringprintf.h" |
| 25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
| 26 #include "build/build_config.h" | 26 #include "build/build_config.h" |
| 27 #include "chrome/common/child_process_logging.h" | 27 #include "chrome/common/child_process_logging.h" |
| 28 #include "chrome/common/chrome_constants.h" | 28 #include "chrome/common/chrome_constants.h" |
| 29 #include "chrome/common/chrome_features.h" |
| 29 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
| 30 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| 31 #include "chrome/common/crash_keys.h" | 32 #include "chrome/common/crash_keys.h" |
| 32 #include "chrome/common/pepper_flash.h" | 33 #include "chrome/common/pepper_flash.h" |
| 33 #include "chrome/common/secure_origin_whitelist.h" | 34 #include "chrome/common/secure_origin_whitelist.h" |
| 34 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
| 35 #include "chrome/grit/common_resources.h" | 36 #include "chrome/grit/common_resources.h" |
| 36 #include "components/dom_distiller/core/url_constants.h" | 37 #include "components/dom_distiller/core/url_constants.h" |
| 37 #include "components/version_info/version_info.h" | 38 #include "components/version_info/version_info.h" |
| 38 #include "content/public/common/cdm_info.h" | 39 #include "content/public/common/cdm_info.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 plugin.mime_types.push_back(swf_mime_type); | 266 plugin.mime_types.push_back(swf_mime_type); |
| 266 content::WebPluginMimeType spl_mime_type(content::kFlashPluginSplMimeType, | 267 content::WebPluginMimeType spl_mime_type(content::kFlashPluginSplMimeType, |
| 267 content::kFlashPluginSplExtension, | 268 content::kFlashPluginSplExtension, |
| 268 content::kFlashPluginSplDescription); | 269 content::kFlashPluginSplDescription); |
| 269 plugin.mime_types.push_back(spl_mime_type); | 270 plugin.mime_types.push_back(spl_mime_type); |
| 270 | 271 |
| 271 return plugin; | 272 return plugin; |
| 272 } | 273 } |
| 273 | 274 |
| 274 bool GetCommandLinePepperFlash(content::PepperPluginInfo* plugin) { | 275 bool GetCommandLinePepperFlash(content::PepperPluginInfo* plugin) { |
| 276 #if defined(OS_CHROMEOS) |
| 277 // On Chrome OS, we cannot test component flash updates reliably unless we |
| 278 // guarantee that the component updated flash plugin will be used. |
| 279 if (base::FeatureList::IsEnabled(features::kComponentFlashOnly)) |
| 280 return false; |
| 281 #endif // defined(OS_CHROMEOS) |
| 282 |
| 275 const base::CommandLine::StringType flash_path = | 283 const base::CommandLine::StringType flash_path = |
| 276 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( | 284 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( |
| 277 switches::kPpapiFlashPath); | 285 switches::kPpapiFlashPath); |
| 278 if (flash_path.empty()) | 286 if (flash_path.empty()) |
| 279 return false; | 287 return false; |
| 280 | 288 |
| 281 // Also get the version from the command-line. Should be something like 11.2 | 289 // Also get the version from the command-line. Should be something like 11.2 |
| 282 // or 11.2.123.45. | 290 // or 11.2.123.45. |
| 283 std::string flash_version = | 291 std::string flash_version = |
| 284 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 292 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 if (!origin_trial_policy_) | 694 if (!origin_trial_policy_) |
| 687 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); | 695 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); |
| 688 return origin_trial_policy_.get(); | 696 return origin_trial_policy_.get(); |
| 689 } | 697 } |
| 690 | 698 |
| 691 #if defined(OS_ANDROID) | 699 #if defined(OS_ANDROID) |
| 692 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 700 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
| 693 return new ChromeMediaClientAndroid(); | 701 return new ChromeMediaClientAndroid(); |
| 694 } | 702 } |
| 695 #endif // OS_ANDROID | 703 #endif // OS_ANDROID |
| OLD | NEW |