| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/plugins/npapi/mock_plugin_list.h" | 5 #include "webkit/plugins/npapi/mock_plugin_list.h" |
| 6 | 6 |
| 7 namespace webkit { | 7 namespace webkit { |
| 8 namespace npapi { | 8 namespace npapi { |
| 9 | 9 |
| 10 MockPluginList::MockPluginList(const PluginGroupDefinition* group_definitions, | 10 MockPluginList::MockPluginList(const PluginGroupDefinition* group_definitions, |
| 11 size_t num_group_definitions) : | 11 size_t num_group_definitions) : |
| 12 PluginList(group_definitions, num_group_definitions) { | 12 PluginList(group_definitions, num_group_definitions) { |
| 13 } | 13 } |
| 14 | 14 |
| 15 MockPluginList::~MockPluginList() { | 15 MockPluginList::~MockPluginList() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 void MockPluginList::AddPluginToLoad(const WebPluginInfo& plugin) { | 18 void MockPluginList::AddPluginToLoad(const WebPluginInfo& plugin) { |
| 19 plugins_to_load_.push_back(plugin); | 19 plugins_to_load_.push_back(plugin); |
| 20 } | 20 } |
| 21 | 21 |
| 22 void MockPluginList::ClearPluginsToLoad() { | 22 void MockPluginList::ClearPluginsToLoad() { |
| 23 plugins_to_load_.clear(); | 23 plugins_to_load_.clear(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 bool MockPluginList::GetPluginsIfNoRefreshNeeded( |
| 27 std::vector<webkit::WebPluginInfo>* plugins) { |
| 28 GetPlugins(plugins); |
| 29 return true; |
| 30 } |
| 31 |
| 26 void MockPluginList::LoadPluginsInternal( | 32 void MockPluginList::LoadPluginsInternal( |
| 27 ScopedVector<PluginGroup>* plugin_groups) { | 33 ScopedVector<PluginGroup>* plugin_groups) { |
| 28 for (size_t i = 0; i < plugins_to_load_.size(); ++i) | 34 for (size_t i = 0; i < plugins_to_load_.size(); ++i) |
| 29 AddToPluginGroups(plugins_to_load_[i], plugin_groups); | 35 AddToPluginGroups(plugins_to_load_[i], plugin_groups); |
| 30 } | 36 } |
| 31 | 37 |
| 32 } // npapi | 38 } // npapi |
| 33 } // webkit | 39 } // webkit |
| OLD | NEW |