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

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

Issue 236073004: Remove kEnableBrowserPluginForAllViewTypes flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/debugger.h" 9 #include "base/debug/debugger.h"
10 #include "content/common/sandbox_win.h" 10 #include "content/common/sandbox_win.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 ShellRenderProcessObserver::GetInstance()->test_delegate(); 111 ShellRenderProcessObserver::GetInstance()->test_delegate();
112 if (delegate == static_cast<WebTestDelegate*>(test_runner)) 112 if (delegate == static_cast<WebTestDelegate*>(test_runner))
113 ShellRenderProcessObserver::GetInstance()->SetMainWindow(render_view); 113 ShellRenderProcessObserver::GetInstance()->SetMainWindow(render_view);
114 } 114 }
115 115
116 bool ShellContentRendererClient::OverrideCreatePlugin( 116 bool ShellContentRendererClient::OverrideCreatePlugin(
117 RenderFrame* render_frame, 117 RenderFrame* render_frame,
118 WebLocalFrame* frame, 118 WebLocalFrame* frame,
119 const WebPluginParams& params, 119 const WebPluginParams& params,
120 WebPlugin** plugin) { 120 WebPlugin** plugin) {
121 std::string mime_type = params.mimeType.utf8();
122 if (mime_type == content::kBrowserPluginMimeType) {
123 // Allow browser plugin in content_shell only if it is forced by flag.
124 // Returning true here disables the plugin.
125 return !CommandLine::ForCurrentProcess()->HasSwitch(
126 switches::kEnableBrowserPluginForAllViewTypes);
127 }
128 return false; 121 return false;
129 } 122 }
130 123
131 WebMediaStreamCenter* 124 WebMediaStreamCenter*
132 ShellContentRendererClient::OverrideCreateWebMediaStreamCenter( 125 ShellContentRendererClient::OverrideCreateWebMediaStreamCenter(
133 WebMediaStreamCenterClient* client) { 126 WebMediaStreamCenterClient* client) {
134 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 127 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
135 return NULL; 128 return NULL;
136 #if defined(ENABLE_WEBRTC) 129 #if defined(ENABLE_WEBRTC)
137 WebTestInterfaces* interfaces = 130 WebTestInterfaces* interfaces =
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 if (!ShellRenderProcessObserver::GetInstance()->test_delegate()) 189 if (!ShellRenderProcessObserver::GetInstance()->test_delegate())
197 ShellRenderProcessObserver::GetInstance()->SetTestDelegate(test_runner); 190 ShellRenderProcessObserver::GetInstance()->SetTestDelegate(test_runner);
198 proxy->setInterfaces( 191 proxy->setInterfaces(
199 ShellRenderProcessObserver::GetInstance()->test_interfaces()); 192 ShellRenderProcessObserver::GetInstance()->test_interfaces());
200 test_runner->proxy()->setDelegate( 193 test_runner->proxy()->setDelegate(
201 ShellRenderProcessObserver::GetInstance()->test_delegate()); 194 ShellRenderProcessObserver::GetInstance()->test_delegate());
202 } 195 }
203 196
204 bool ShellContentRendererClient::AllowBrowserPlugin( 197 bool ShellContentRendererClient::AllowBrowserPlugin(
205 blink::WebPluginContainer* container) { 198 blink::WebPluginContainer* container) {
206 if (CommandLine::ForCurrentProcess()->HasSwitch( 199 return true;
207 switches::kEnableBrowserPluginForAllViewTypes)) {
208 // Allow BrowserPlugin if forced by command line flag. This is generally
209 // true for tests.
210 return true;
211 }
212 return ContentRendererClient::AllowBrowserPlugin(container);
213 } 200 }
214 201
215 } // namespace content 202 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698