OLD | NEW |
(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 } |
OLD | NEW |