| 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" | |
| 30 #include "chrome/common/chrome_paths.h" | 29 #include "chrome/common/chrome_paths.h" |
| 31 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
| 32 #include "chrome/common/crash_keys.h" | 31 #include "chrome/common/crash_keys.h" |
| 33 #include "chrome/common/pepper_flash.h" | 32 #include "chrome/common/pepper_flash.h" |
| 34 #include "chrome/common/secure_origin_whitelist.h" | 33 #include "chrome/common/secure_origin_whitelist.h" |
| 35 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
| 36 #include "chrome/grit/common_resources.h" | 35 #include "chrome/grit/common_resources.h" |
| 37 #include "components/dom_distiller/core/url_constants.h" | 36 #include "components/dom_distiller/core/url_constants.h" |
| 38 #include "components/version_info/version_info.h" | 37 #include "components/version_info/version_info.h" |
| 39 #include "content/public/common/cdm_info.h" | 38 #include "content/public/common/cdm_info.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 plugin.mime_types.push_back(swf_mime_type); | 265 plugin.mime_types.push_back(swf_mime_type); |
| 267 content::WebPluginMimeType spl_mime_type(content::kFlashPluginSplMimeType, | 266 content::WebPluginMimeType spl_mime_type(content::kFlashPluginSplMimeType, |
| 268 content::kFlashPluginSplExtension, | 267 content::kFlashPluginSplExtension, |
| 269 content::kFlashPluginSplDescription); | 268 content::kFlashPluginSplDescription); |
| 270 plugin.mime_types.push_back(spl_mime_type); | 269 plugin.mime_types.push_back(spl_mime_type); |
| 271 | 270 |
| 272 return plugin; | 271 return plugin; |
| 273 } | 272 } |
| 274 | 273 |
| 275 bool GetCommandLinePepperFlash(content::PepperPluginInfo* plugin) { | 274 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 | |
| 283 const base::CommandLine::StringType flash_path = | 275 const base::CommandLine::StringType flash_path = |
| 284 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( | 276 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( |
| 285 switches::kPpapiFlashPath); | 277 switches::kPpapiFlashPath); |
| 286 if (flash_path.empty()) | 278 if (flash_path.empty()) |
| 287 return false; | 279 return false; |
| 288 | 280 |
| 289 // Also get the version from the command-line. Should be something like 11.2 | 281 // Also get the version from the command-line. Should be something like 11.2 |
| 290 // or 11.2.123.45. | 282 // or 11.2.123.45. |
| 291 std::string flash_version = | 283 std::string flash_version = |
| 292 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 284 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 if (!origin_trial_policy_) | 686 if (!origin_trial_policy_) |
| 695 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); | 687 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); |
| 696 return origin_trial_policy_.get(); | 688 return origin_trial_policy_.get(); |
| 697 } | 689 } |
| 698 | 690 |
| 699 #if defined(OS_ANDROID) | 691 #if defined(OS_ANDROID) |
| 700 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 692 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
| 701 return new ChromeMediaClientAndroid(); | 693 return new ChromeMediaClientAndroid(); |
| 702 } | 694 } |
| 703 #endif // OS_ANDROID | 695 #endif // OS_ANDROID |
| OLD | NEW |