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

Side by Side 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: Rebase ToT 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/test/test_plugin_service.h"
6
7 #include "base/bind.h"
8 #include "base/message_loop.h"
9 #include "webkit/plugins/npapi/plugin_group.h"
10 #include "webkit/plugins/npapi/plugin_list.h"
11 #include "webkit/plugins/webplugininfo.h"
12
13 TestPluginService::TestPluginService(webkit::npapi::PluginList* plugin_list)
14 : PluginService(plugin_list) {
15 // Reset the callback so that tests don't trip the assertion set by the
16 // base class.
17 plugin_list->set_will_load_plugins_callback(base::Closure());
18 }
19
20 TestPluginService::~TestPluginService() {
21 }
22
23 void TestPluginService::GetPlugins(const GetPluginsCallback& cb) {
24 std::vector<webkit::WebPluginInfo> plugins;
25 plugin_list()->GetPlugins(&plugins);
26 MessageLoop::current()->PostTask(FROM_HERE, base::Bind(cb, plugins));
27 }
28
29 void TestPluginService::GetPluginGroups(const GetPluginGroupsCallback& cb) {
30 std::vector<webkit::npapi::PluginGroup> groups;
31 plugin_list()->GetPluginGroups(true, &groups);
32 MessageLoop::current()->PostTask(FROM_HERE, base::Bind(cb, groups));
33 }
OLDNEW
« 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