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

Unified Diff: content/shell/shell_plugin_service_filter.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
« no previous file with comments | « content/shell/shell_plugin_service_filter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_plugin_service_filter.cc
diff --git a/content/shell/shell_plugin_service_filter.cc b/content/shell/shell_plugin_service_filter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bd26bbc82b525313e580c35e15a840a10f0b3d78
--- /dev/null
+++ b/content/shell/shell_plugin_service_filter.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/shell/shell_plugin_service_filter.h"
+
+#include "base/utf_string_conversions.h"
+#include "webkit/plugins/webplugininfo.h"
+
+namespace content {
+
+ShellPluginServiceFilter::ShellPluginServiceFilter() {}
+
+ShellPluginServiceFilter::~ShellPluginServiceFilter() {}
+
+bool ShellPluginServiceFilter::IsPluginAvailable(
+ int render_process_id,
+ int render_view_id,
+ const void* context,
+ const GURL& url,
+ const GURL& policy_url,
+ webkit::WebPluginInfo* plugin) {
+ if (plugin->name == ASCIIToUTF16("WebKit Test PlugIn") ||
+ plugin->name == ASCIIToUTF16("NPAPI Test Plugin")) {
+ return true;
+ }
+ return false;
abarth-chromium 2013/05/28 07:56:13 Why not just: return plugin->name == ASCIIToUTF16
+}
+
+bool ShellPluginServiceFilter::CanLoadPlugin(int render_process_id,
+ const base::FilePath& path) {
+ return true;
+}
+
+} // namespace content
« no previous file with comments | « content/shell/shell_plugin_service_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698