| Index: chrome/renderer/chrome_content_renderer_client.cc
|
| diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
|
| index c6a64678a96c6fc812126997a721203d85967697..17c0a056c7ccfbb57341f55d6cfef09574b2814a 100644
|
| --- a/chrome/renderer/chrome_content_renderer_client.cc
|
| +++ b/chrome/renderer/chrome_content_renderer_client.cc
|
| @@ -96,6 +96,7 @@
|
| #include "ipc/ipc_sync_channel.h"
|
| #include "net/base/net_errors.h"
|
| #include "ppapi/c/private/ppb_pdf.h"
|
| +#include "ppapi/features/features.h"
|
| #include "ppapi/shared_impl/ppapi_switches.h"
|
| #include "printing/features/features.h"
|
| #include "services/service_manager/public/cpp/interface_provider.h"
|
| @@ -134,7 +135,7 @@
|
| #include "extensions/renderer/renderer_extension_registry.h"
|
| #endif
|
|
|
| -#if defined(ENABLE_PLUGINS)
|
| +#if BUILDFLAG(ENABLE_PLUGINS)
|
| #include "chrome/common/plugin_utils.h"
|
| #include "chrome/renderer/plugins/chrome_plugin_placeholder.h"
|
| #include "chrome/renderer/plugins/power_saver_info.h"
|
| @@ -202,7 +203,7 @@ void RecordYouTubeRewriteUMA(internal::YouTubeRewriteStatus status) {
|
| }
|
|
|
| // Whitelist PPAPI for Android Runtime for Chromium. (See crbug.com/383937)
|
| -#if defined(ENABLE_PLUGINS)
|
| +#if BUILDFLAG(ENABLE_PLUGINS)
|
| const char* const kPredefinedAllowedCameraDeviceOrigins[] = {
|
| "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F",
|
| "4EB74897CB187C7633357C2FE832E0AD6A44883A"
|
| @@ -214,7 +215,7 @@ const char* const kPredefinedAllowedCompositorOrigins[] = {
|
| };
|
| #endif
|
|
|
| -#if defined(ENABLE_PLUGINS)
|
| +#if BUILDFLAG(ENABLE_PLUGINS)
|
| void AppendParams(const std::vector<base::string16>& additional_names,
|
| const std::vector<base::string16>& additional_values,
|
| WebVector<WebString>* existing_names,
|
| @@ -241,7 +242,7 @@ void AppendParams(const std::vector<base::string16>& additional_names,
|
| existing_names->swap(names);
|
| existing_values->swap(values);
|
| }
|
| -#endif // defined(ENABLE_PLUGINS)
|
| +#endif // BUILDFLAG(ENABLE_PLUGINS)
|
|
|
| #if BUILDFLAG(ENABLE_SPELLCHECK)
|
| class SpellCheckReplacer : public content::RenderViewVisitor {
|
| @@ -303,7 +304,7 @@ ChromeContentRendererClient::ChromeContentRendererClient()
|
| extensions::ExtensionsRendererClient::Set(
|
| ChromeExtensionsRendererClient::GetInstance());
|
| #endif
|
| -#if defined(ENABLE_PLUGINS)
|
| +#if BUILDFLAG(ENABLE_PLUGINS)
|
| for (size_t i = 0; i < arraysize(kPredefinedAllowedCameraDeviceOrigins); ++i)
|
| allowed_camera_device_origins_.insert(
|
| kPredefinedAllowedCameraDeviceOrigins[i]);
|
| @@ -463,7 +464,7 @@ void ChromeContentRendererClient::RenderFrameCreated(
|
| render_frame);
|
| #endif
|
|
|
| -#if defined(ENABLE_PLUGINS)
|
| +#if BUILDFLAG(ENABLE_PLUGINS)
|
| new PepperHelper(render_frame);
|
| #endif
|
|
|
| @@ -567,18 +568,18 @@ bool ChromeContentRendererClient::OverrideCreatePlugin(
|
| #endif
|
|
|
| GURL url(params.url);
|
| -#if defined(ENABLE_PLUGINS)
|
| +#if BUILDFLAG(ENABLE_PLUGINS)
|
| ChromeViewHostMsg_GetPluginInfo_Output output;
|
| render_frame->Send(new ChromeViewHostMsg_GetPluginInfo(
|
| render_frame->GetRoutingID(), url, frame->top()->getSecurityOrigin(),
|
| orig_mime_type, &output));
|
| *plugin = CreatePlugin(render_frame, frame, params, output);
|
| -#else // !defined(ENABLE_PLUGINS)
|
| +#else // !BUILDFLAG(ENABLE_PLUGINS)
|
| PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url);
|
| *plugin = NonLoadablePluginPlaceholder::CreateNotSupportedPlugin(
|
| render_frame, frame, params)->plugin();
|
|
|
| -#endif // defined(ENABLE_PLUGINS)
|
| +#endif // BUILDFLAG(ENABLE_PLUGINS)
|
| return true;
|
| }
|
|
|
| @@ -612,7 +613,7 @@ void ChromeContentRendererClient::DeferMediaLoad(
|
| closure.Run();
|
| }
|
|
|
| -#if defined(ENABLE_PLUGINS)
|
| +#if BUILDFLAG(ENABLE_PLUGINS)
|
| WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
| content::RenderFrame* render_frame,
|
| WebLocalFrame* frame,
|
| @@ -878,7 +879,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
| placeholder->SetStatus(status);
|
| return placeholder->plugin();
|
| }
|
| -#endif // defined(ENABLE_PLUGINS)
|
| +#endif // BUILDFLAG(ENABLE_PLUGINS)
|
|
|
| // For NaCl content handling plugins, the NaCl manifest is stored in an
|
| // additonal 'nacl' param associated with the MIME type.
|
| @@ -1199,7 +1200,7 @@ bool ChromeContentRendererClient::IsExternalPepperPlugin(
|
| return module_name == "Native Client";
|
| }
|
|
|
| -#if defined(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS)
|
| +#if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS)
|
| bool ChromeContentRendererClient::IsExtensionOrSharedModuleWhitelisted(
|
| const GURL& url, const std::set<std::string>& whitelist) {
|
| const extensions::ExtensionSet* extension_set =
|
| @@ -1269,7 +1270,7 @@ ChromeContentRendererClient::CreateWorkerContentSettingsClientProxy(
|
| }
|
|
|
| bool ChromeContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() {
|
| -#if defined(ENABLE_PLUGINS)
|
| +#if BUILDFLAG(ENABLE_PLUGINS)
|
| // Allow access for tests.
|
| if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kEnablePepperTesting)) {
|
| @@ -1288,7 +1289,7 @@ bool ChromeContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() {
|
|
|
| bool ChromeContentRendererClient::IsPluginAllowedToUseCameraDeviceAPI(
|
| const GURL& url) {
|
| -#if defined(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS)
|
| +#if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS)
|
| if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kEnablePepperTesting))
|
| return true;
|
| @@ -1302,7 +1303,7 @@ bool ChromeContentRendererClient::IsPluginAllowedToUseCameraDeviceAPI(
|
|
|
| bool ChromeContentRendererClient::IsPluginAllowedToUseCompositorAPI(
|
| const GURL& url) {
|
| -#if defined(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS)
|
| +#if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS)
|
| if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kEnablePepperTesting))
|
| return true;
|
|
|