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

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: Created 6 years, 8 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/public/common/content_constants.h" 10 #include "content/public/common/content_constants.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 ShellRenderProcessObserver::GetInstance()->test_delegate(); 80 ShellRenderProcessObserver::GetInstance()->test_delegate();
81 if (delegate == static_cast<WebTestDelegate*>(test_runner)) 81 if (delegate == static_cast<WebTestDelegate*>(test_runner))
82 ShellRenderProcessObserver::GetInstance()->SetMainWindow(render_view); 82 ShellRenderProcessObserver::GetInstance()->SetMainWindow(render_view);
83 } 83 }
84 84
85 bool ShellContentRendererClient::OverrideCreatePlugin( 85 bool ShellContentRendererClient::OverrideCreatePlugin(
86 RenderFrame* render_frame, 86 RenderFrame* render_frame,
87 WebFrame* frame, 87 WebFrame* frame,
88 const WebPluginParams& params, 88 const WebPluginParams& params,
89 WebPlugin** plugin) { 89 WebPlugin** plugin) {
90 std::string mime_type = params.mimeType.utf8();
91 if (mime_type == content::kBrowserPluginMimeType) {
92 // Allow browser plugin in content_shell only if it is forced by flag.
93 // Returning true here disables the plugin.
94 return !CommandLine::ForCurrentProcess()->HasSwitch(
95 switches::kEnableBrowserPluginForAllViewTypes);
96 }
97 return false; 90 return false;
98 } 91 }
99 92
100 WebMediaStreamCenter* 93 WebMediaStreamCenter*
101 ShellContentRendererClient::OverrideCreateWebMediaStreamCenter( 94 ShellContentRendererClient::OverrideCreateWebMediaStreamCenter(
102 WebMediaStreamCenterClient* client) { 95 WebMediaStreamCenterClient* client) {
103 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 96 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
104 return NULL; 97 return NULL;
105 #if defined(ENABLE_WEBRTC) 98 #if defined(ENABLE_WEBRTC)
106 WebTestInterfaces* interfaces = 99 WebTestInterfaces* interfaces =
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 if (!ShellRenderProcessObserver::GetInstance()->test_delegate()) 158 if (!ShellRenderProcessObserver::GetInstance()->test_delegate())
166 ShellRenderProcessObserver::GetInstance()->SetTestDelegate(test_runner); 159 ShellRenderProcessObserver::GetInstance()->SetTestDelegate(test_runner);
167 proxy->setInterfaces( 160 proxy->setInterfaces(
168 ShellRenderProcessObserver::GetInstance()->test_interfaces()); 161 ShellRenderProcessObserver::GetInstance()->test_interfaces());
169 test_runner->proxy()->setDelegate( 162 test_runner->proxy()->setDelegate(
170 ShellRenderProcessObserver::GetInstance()->test_delegate()); 163 ShellRenderProcessObserver::GetInstance()->test_delegate());
171 } 164 }
172 165
173 bool ShellContentRendererClient::AllowBrowserPlugin( 166 bool ShellContentRendererClient::AllowBrowserPlugin(
174 blink::WebPluginContainer* container) { 167 blink::WebPluginContainer* container) {
175 if (CommandLine::ForCurrentProcess()->HasSwitch(
176 switches::kEnableBrowserPluginForAllViewTypes)) {
177 // Allow BrowserPlugin if forced by command line flag. This is generally
178 // true for tests.
179 return true;
180 }
181 return ContentRendererClient::AllowBrowserPlugin(container); 168 return ContentRendererClient::AllowBrowserPlugin(container);
Fady Samuel 2014/04/12 15:49:10 Do the tests content_browsertests BrowserPluginHos
Zachary Kuznia 2014/04/16 23:53:38 They do not. Should I just return true here?
182 } 169 }
183 170
184 } // namespace content 171 } // 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