OLD | NEW |
---|---|
(Empty) | |
1 // 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
| |
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() { | |
15 SetPluginListForTesting(plugin_list); | |
16 Init(); | |
17 } | |
18 | |
19 TestPluginService::~TestPluginService() { | |
20 } | |
21 | |
22 void TestPluginService::GetPlugins(const GetPluginsCallback& cb) { | |
23 std::vector<webkit::WebPluginInfo> plugins; | |
24 plugin_list()->GetPlugins(&plugins); | |
25 MessageLoop::current()->PostTask(FROM_HERE, base::Bind(cb, plugins)); | |
26 } | |
27 | |
28 void TestPluginService::GetPluginGroups(const GetPluginGroupsCallback& cb) { | |
29 std::vector<webkit::npapi::PluginGroup> groups; | |
30 plugin_list()->GetPluginGroups(true, &groups); | |
31 MessageLoop::current()->PostTask(FROM_HERE, base::Bind(cb, groups)); | |
32 } | |
OLD | NEW |