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

Unified Diff: content/shell/shell_browser_main_parts.cc

Issue 16059004: [content shell] only allow test plugins to load during layout tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/shell_browser_main_parts.cc
diff --git a/content/shell/shell_browser_main_parts.cc b/content/shell/shell_browser_main_parts.cc
index 9934a7b4fcc2764d90147b08db9be9dc5373126d..acf0a13a136a78c8c1b2dcc4f95cbfb8cafc8860 100644
--- a/content/shell/shell_browser_main_parts.cc
+++ b/content/shell/shell_browser_main_parts.cc
@@ -11,6 +11,7 @@
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "cc/base/switches.h"
+#include "content/public/browser/plugin_service.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/public/common/url_constants.h"
@@ -18,6 +19,7 @@
#include "content/shell/shell.h"
#include "content/shell/shell_browser_context.h"
#include "content/shell/shell_devtools_delegate.h"
+#include "content/shell/shell_plugin_service_filter.h"
#include "googleurl/src/gurl.h"
#include "grit/net_resources.h"
#include "net/base/net_module.h"
@@ -75,7 +77,8 @@ ShellBrowserMainParts::ShellBrowserMainParts(
: BrowserMainParts(),
parameters_(parameters),
run_message_loop_(true),
- devtools_delegate_(NULL) {
+ devtools_delegate_(NULL),
+ plugin_service_filter_(NULL) {
}
ShellBrowserMainParts::~ShellBrowserMainParts() {
@@ -120,6 +123,10 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
NULL,
MSG_ROUTING_NONE,
gfx::Size());
+ } else {
+ PluginService* plugin_service = PluginService::GetInstance();
+ plugin_service_filter_.reset(new ShellPluginServiceFilter);
+ plugin_service->SetFilter(plugin_service_filter_.get());
}
if (parameters_.ui_task) {

Powered by Google App Engine
This is Rietveld 408576698