Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: content/shell/renderer/shell_content_renderer_client.cc

Issue 2512563003: Convert enable_plugins to a buildflag header. (Closed)
Patch Set: Merge Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/shell/renderer/shell_content_renderer_client.h" 5 #include "content/shell/renderer/shell_content_renderer_client.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "components/cdm/renderer/external_clear_key_key_system_properties.h" 13 #include "components/cdm/renderer/external_clear_key_key_system_properties.h"
14 #include "components/web_cache/renderer/web_cache_impl.h" 14 #include "components/web_cache/renderer/web_cache_impl.h"
15 #include "content/public/test/test_service.mojom.h" 15 #include "content/public/test/test_service.mojom.h"
16 #include "content/shell/common/shell_switches.h" 16 #include "content/shell/common/shell_switches.h"
17 #include "content/shell/renderer/shell_render_view_observer.h" 17 #include "content/shell/renderer/shell_render_view_observer.h"
18 #include "mojo/public/cpp/bindings/binding.h" 18 #include "mojo/public/cpp/bindings/binding.h"
19 #include "mojo/public/cpp/system/message_pipe.h" 19 #include "mojo/public/cpp/system/message_pipe.h"
20 #include "ppapi/features/features.h"
20 #include "services/service_manager/public/cpp/interface_registry.h" 21 #include "services/service_manager/public/cpp/interface_registry.h"
21 #include "third_party/WebKit/public/web/WebTestingSupport.h" 22 #include "third_party/WebKit/public/web/WebTestingSupport.h"
22 #include "third_party/WebKit/public/web/WebView.h" 23 #include "third_party/WebKit/public/web/WebView.h"
23 #include "v8/include/v8.h" 24 #include "v8/include/v8.h"
24 25
25 #if defined(ENABLE_PLUGINS) 26 #if BUILDFLAG(ENABLE_PLUGINS)
26 #include "ppapi/shared_impl/ppapi_switches.h" 27 #include "ppapi/shared_impl/ppapi_switches.h"
27 #endif 28 #endif
28 29
29 #if defined(ENABLE_MOJO_CDM) 30 #if defined(ENABLE_MOJO_CDM)
30 #include "base/feature_list.h" 31 #include "base/feature_list.h"
31 #include "media/base/media_switches.h" 32 #include "media/base/media_switches.h"
32 #endif 33 #endif
33 34
34 namespace content { 35 namespace content {
35 36
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 void ShellContentRendererClient::RenderThreadStarted() { 103 void ShellContentRendererClient::RenderThreadStarted() {
103 web_cache_impl_.reset(new web_cache::WebCacheImpl()); 104 web_cache_impl_.reset(new web_cache::WebCacheImpl());
104 } 105 }
105 106
106 void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) { 107 void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) {
107 new ShellRenderViewObserver(render_view); 108 new ShellRenderViewObserver(render_view);
108 } 109 }
109 110
110 bool ShellContentRendererClient::IsPluginAllowedToUseCompositorAPI( 111 bool ShellContentRendererClient::IsPluginAllowedToUseCompositorAPI(
111 const GURL& url) { 112 const GURL& url) {
112 #if defined(ENABLE_PLUGINS) 113 #if BUILDFLAG(ENABLE_PLUGINS)
113 return base::CommandLine::ForCurrentProcess()->HasSwitch( 114 return base::CommandLine::ForCurrentProcess()->HasSwitch(
114 switches::kEnablePepperTesting); 115 switches::kEnablePepperTesting);
115 #else 116 #else
116 return false; 117 return false;
117 #endif 118 #endif
118 } 119 }
119 120
120 bool ShellContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() { 121 bool ShellContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() {
121 #if defined(ENABLE_PLUGINS) 122 #if BUILDFLAG(ENABLE_PLUGINS)
122 return base::CommandLine::ForCurrentProcess()->HasSwitch( 123 return base::CommandLine::ForCurrentProcess()->HasSwitch(
123 switches::kEnablePepperTesting); 124 switches::kEnablePepperTesting);
124 #else 125 #else
125 return false; 126 return false;
126 #endif 127 #endif
127 } 128 }
128 129
129 void ShellContentRendererClient::DidInitializeWorkerContextOnWorkerThread( 130 void ShellContentRendererClient::DidInitializeWorkerContextOnWorkerThread(
130 v8::Local<v8::Context> context) { 131 v8::Local<v8::Context> context) {
131 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 132 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
(...skipping 15 matching lines...) Expand all
147 return; 148 return;
148 149
149 static const char kExternalClearKeyKeySystem[] = 150 static const char kExternalClearKeyKeySystem[] =
150 "org.chromium.externalclearkey"; 151 "org.chromium.externalclearkey";
151 key_systems->emplace_back( 152 key_systems->emplace_back(
152 new cdm::ExternalClearKeyProperties(kExternalClearKeyKeySystem)); 153 new cdm::ExternalClearKeyProperties(kExternalClearKeyKeySystem));
153 } 154 }
154 #endif 155 #endif
155 156
156 } // namespace content 157 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/layout_test/layout_test_browser_main_parts.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698