| 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> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "components/version_info/version_info.h" | 37 #include "components/version_info/version_info.h" |
| 38 #include "content/public/common/cdm_info.h" | 38 #include "content/public/common/cdm_info.h" |
| 39 #include "content/public/common/content_constants.h" | 39 #include "content/public/common/content_constants.h" |
| 40 #include "content/public/common/content_switches.h" | 40 #include "content/public/common/content_switches.h" |
| 41 #include "content/public/common/url_constants.h" | 41 #include "content/public/common/url_constants.h" |
| 42 #include "content/public/common/user_agent.h" | 42 #include "content/public/common/user_agent.h" |
| 43 #include "extensions/common/constants.h" | 43 #include "extensions/common/constants.h" |
| 44 #include "extensions/features/features.h" | 44 #include "extensions/features/features.h" |
| 45 #include "gpu/config/gpu_info.h" | 45 #include "gpu/config/gpu_info.h" |
| 46 #include "net/http/http_util.h" | 46 #include "net/http/http_util.h" |
| 47 #include "pdf/features.h" |
| 47 #include "ppapi/features/features.h" | 48 #include "ppapi/features/features.h" |
| 48 #include "ui/base/l10n/l10n_util.h" | 49 #include "ui/base/l10n/l10n_util.h" |
| 49 #include "ui/base/layout.h" | 50 #include "ui/base/layout.h" |
| 50 #include "ui/base/resource/resource_bundle.h" | 51 #include "ui/base/resource/resource_bundle.h" |
| 51 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 52 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
| 52 | 53 |
| 53 #if defined(OS_LINUX) | 54 #if defined(OS_LINUX) |
| 54 #include <fcntl.h> | 55 #include <fcntl.h> |
| 55 #include "chrome/common/component_flash_hint_file_linux.h" | 56 #include "chrome/common/component_flash_hint_file_linux.h" |
| 56 #include "sandbox/linux/services/credentials.h" | 57 #include "sandbox/linux/services/credentials.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 83 #include "chrome/common/widevine_cdm_constants.h" | 84 #include "chrome/common/widevine_cdm_constants.h" |
| 84 #endif | 85 #endif |
| 85 | 86 |
| 86 #if defined(OS_ANDROID) | 87 #if defined(OS_ANDROID) |
| 87 #include "chrome/common/chrome_media_client_android.h" | 88 #include "chrome/common/chrome_media_client_android.h" |
| 88 #endif | 89 #endif |
| 89 | 90 |
| 90 namespace { | 91 namespace { |
| 91 | 92 |
| 92 #if BUILDFLAG(ENABLE_PLUGINS) | 93 #if BUILDFLAG(ENABLE_PLUGINS) |
| 93 #if defined(ENABLE_PDF) | 94 #if BUILDFLAG(ENABLE_PDF) |
| 94 const char kPDFPluginExtension[] = "pdf"; | 95 const char kPDFPluginExtension[] = "pdf"; |
| 95 const char kPDFPluginDescription[] = "Portable Document Format"; | 96 const char kPDFPluginDescription[] = "Portable Document Format"; |
| 96 const char kPDFPluginOutOfProcessMimeType[] = | 97 const char kPDFPluginOutOfProcessMimeType[] = |
| 97 "application/x-google-chrome-pdf"; | 98 "application/x-google-chrome-pdf"; |
| 98 const uint32_t kPDFPluginPermissions = | 99 const uint32_t kPDFPluginPermissions = |
| 99 ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV; | 100 ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV; |
| 100 #endif // defined(ENABLE_PDF) | 101 #endif // BUILDFLAG(ENABLE_PDF) |
| 101 | 102 |
| 102 content::PepperPluginInfo::GetInterfaceFunc g_pdf_get_interface; | 103 content::PepperPluginInfo::GetInterfaceFunc g_pdf_get_interface; |
| 103 content::PepperPluginInfo::PPP_InitializeModuleFunc g_pdf_initialize_module; | 104 content::PepperPluginInfo::PPP_InitializeModuleFunc g_pdf_initialize_module; |
| 104 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_pdf_shutdown_module; | 105 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_pdf_shutdown_module; |
| 105 | 106 |
| 106 #if !defined(DISABLE_NACL) | 107 #if !defined(DISABLE_NACL) |
| 107 content::PepperPluginInfo::GetInterfaceFunc g_nacl_get_interface; | 108 content::PepperPluginInfo::GetInterfaceFunc g_nacl_get_interface; |
| 108 content::PepperPluginInfo::PPP_InitializeModuleFunc g_nacl_initialize_module; | 109 content::PepperPluginInfo::PPP_InitializeModuleFunc g_nacl_initialize_module; |
| 109 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_nacl_shutdown_module; | 110 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_nacl_shutdown_module; |
| 110 #endif | 111 #endif |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 return false; | 145 return false; |
| 145 } | 146 } |
| 146 #endif // defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) | 147 #endif // defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) |
| 147 | 148 |
| 148 // Appends the known built-in plugins to the given vector. Some built-in | 149 // Appends the known built-in plugins to the given vector. Some built-in |
| 149 // plugins are "internal" which means they are compiled into the Chrome binary, | 150 // plugins are "internal" which means they are compiled into the Chrome binary, |
| 150 // and some are extra shared libraries distributed with the browser (these are | 151 // and some are extra shared libraries distributed with the browser (these are |
| 151 // not marked internal, aside from being automatically registered, they're just | 152 // not marked internal, aside from being automatically registered, they're just |
| 152 // regular plugins). | 153 // regular plugins). |
| 153 void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { | 154 void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { |
| 154 #if defined(ENABLE_PDF) | 155 #if BUILDFLAG(ENABLE_PDF) |
| 155 content::PepperPluginInfo pdf_info; | 156 content::PepperPluginInfo pdf_info; |
| 156 pdf_info.is_internal = true; | 157 pdf_info.is_internal = true; |
| 157 pdf_info.is_out_of_process = true; | 158 pdf_info.is_out_of_process = true; |
| 158 pdf_info.name = ChromeContentClient::kPDFPluginName; | 159 pdf_info.name = ChromeContentClient::kPDFPluginName; |
| 159 pdf_info.description = kPDFPluginDescription; | 160 pdf_info.description = kPDFPluginDescription; |
| 160 pdf_info.path = base::FilePath::FromUTF8Unsafe( | 161 pdf_info.path = base::FilePath::FromUTF8Unsafe( |
| 161 ChromeContentClient::kPDFPluginPath); | 162 ChromeContentClient::kPDFPluginPath); |
| 162 content::WebPluginMimeType pdf_mime_type( | 163 content::WebPluginMimeType pdf_mime_type( |
| 163 kPDFPluginOutOfProcessMimeType, | 164 kPDFPluginOutOfProcessMimeType, |
| 164 kPDFPluginExtension, | 165 kPDFPluginExtension, |
| 165 kPDFPluginDescription); | 166 kPDFPluginDescription); |
| 166 pdf_info.mime_types.push_back(pdf_mime_type); | 167 pdf_info.mime_types.push_back(pdf_mime_type); |
| 167 pdf_info.internal_entry_points.get_interface = g_pdf_get_interface; | 168 pdf_info.internal_entry_points.get_interface = g_pdf_get_interface; |
| 168 pdf_info.internal_entry_points.initialize_module = g_pdf_initialize_module; | 169 pdf_info.internal_entry_points.initialize_module = g_pdf_initialize_module; |
| 169 pdf_info.internal_entry_points.shutdown_module = g_pdf_shutdown_module; | 170 pdf_info.internal_entry_points.shutdown_module = g_pdf_shutdown_module; |
| 170 pdf_info.permissions = kPDFPluginPermissions; | 171 pdf_info.permissions = kPDFPluginPermissions; |
| 171 plugins->push_back(pdf_info); | 172 plugins->push_back(pdf_info); |
| 172 #endif // defined(ENABLE_PDF) | 173 #endif // BUILDFLAG(ENABLE_PDF) |
| 173 | 174 |
| 174 #if !defined(DISABLE_NACL) | 175 #if !defined(DISABLE_NACL) |
| 175 // Handle Native Client just like the PDF plugin. This means that it is | 176 // Handle Native Client just like the PDF plugin. This means that it is |
| 176 // enabled by default for the non-portable case. This allows apps installed | 177 // enabled by default for the non-portable case. This allows apps installed |
| 177 // from the Chrome Web Store to use NaCl even if the command line switch | 178 // from the Chrome Web Store to use NaCl even if the command line switch |
| 178 // isn't set. For other uses of NaCl we check for the command line switch. | 179 // isn't set. For other uses of NaCl we check for the command line switch. |
| 179 base::FilePath path; | 180 base::FilePath path; |
| 180 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { | 181 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { |
| 181 content::PepperPluginInfo nacl; | 182 content::PepperPluginInfo nacl; |
| 182 // The nacl plugin is now built into the Chromium binary. | 183 // The nacl plugin is now built into the Chromium binary. |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 if (!origin_trial_policy_) | 687 if (!origin_trial_policy_) |
| 687 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); | 688 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); |
| 688 return origin_trial_policy_.get(); | 689 return origin_trial_policy_.get(); |
| 689 } | 690 } |
| 690 | 691 |
| 691 #if defined(OS_ANDROID) | 692 #if defined(OS_ANDROID) |
| 692 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 693 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
| 693 return new ChromeMediaClientAndroid(); | 694 return new ChromeMediaClientAndroid(); |
| 694 } | 695 } |
| 695 #endif // OS_ANDROID | 696 #endif // OS_ANDROID |
| OLD | NEW |