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

Unified Diff: content/test/test_plugin_service.cc

Issue 8493019: Refactor PluginService to take PluginList as a dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Init() Created 9 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 side-by-side diff with in-line comments
Download patch
« content/browser/plugin_service.cc ('K') | « content/test/test_plugin_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_plugin_service.cc
diff --git a/content/test/test_plugin_service.cc b/content/test/test_plugin_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6d8a827385a2b0e7ac0d5474570679a110b8def5
--- /dev/null
+++ b/content/test/test_plugin_service.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
jam 2011/11/08 23:12:57 why do we need a testpluginservice? the testing p
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/test/test_plugin_service.h"
+
+#include "base/bind.h"
+#include "base/message_loop.h"
+#include "webkit/plugins/npapi/plugin_group.h"
+#include "webkit/plugins/npapi/plugin_list.h"
+#include "webkit/plugins/webplugininfo.h"
+
+TestPluginService::TestPluginService(webkit::npapi::PluginList* plugin_list)
+ : PluginService() {
+ SetPluginListForTesting(plugin_list);
+ Init();
+}
+
+TestPluginService::~TestPluginService() {
+}
+
+void TestPluginService::GetPlugins(const GetPluginsCallback& cb) {
+ std::vector<webkit::WebPluginInfo> plugins;
+ plugin_list()->GetPlugins(&plugins);
+ MessageLoop::current()->PostTask(FROM_HERE, base::Bind(cb, plugins));
+}
+
+void TestPluginService::GetPluginGroups(const GetPluginGroupsCallback& cb) {
+ std::vector<webkit::npapi::PluginGroup> groups;
+ plugin_list()->GetPluginGroups(true, &groups);
+ MessageLoop::current()->PostTask(FROM_HERE, base::Bind(cb, groups));
+}
« content/browser/plugin_service.cc ('K') | « content/test/test_plugin_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698