| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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() |
| 11 size_t num_group_definitions) : | 11 : PluginList(1) { |
| 12 PluginList(group_definitions, num_group_definitions) { | |
| 13 } | 12 } |
| 14 | 13 |
| 15 MockPluginList::~MockPluginList() { | 14 MockPluginList::~MockPluginList() { |
| 16 } | 15 } |
| 17 | 16 |
| 18 void MockPluginList::AddPluginToLoad(const WebPluginInfo& plugin) { | 17 void MockPluginList::AddPluginToLoad(const WebPluginInfo& plugin) { |
| 19 plugins_to_load_.push_back(plugin); | 18 plugins_to_load_.push_back(plugin); |
| 20 } | 19 } |
| 21 | 20 |
| 22 void MockPluginList::ClearPluginsToLoad() { | 21 void MockPluginList::ClearPluginsToLoad() { |
| 23 plugins_to_load_.clear(); | 22 plugins_to_load_.clear(); |
| 24 } | 23 } |
| 25 | 24 |
| 26 bool MockPluginList::GetPluginsNoRefresh( | 25 bool MockPluginList::GetPluginsNoRefresh( |
| 27 std::vector<webkit::WebPluginInfo>* plugins) { | 26 std::vector<webkit::WebPluginInfo>* plugins) { |
| 28 GetPlugins(plugins); | 27 GetPlugins(plugins); |
| 29 return true; | 28 return true; |
| 30 } | 29 } |
| 31 | 30 |
| 32 // TODO(ibraaaa): DELETE. http://crbug.com/124396 | |
| 33 void MockPluginList::LoadPluginsInternal( | |
| 34 ScopedVector<PluginGroup>* plugin_groups) { | |
| 35 for (size_t i = 0; i < plugins_to_load_.size(); ++i) | |
| 36 AddToPluginGroups(plugins_to_load_[i], plugin_groups); | |
| 37 } | |
| 38 | |
| 39 void MockPluginList::LoadPluginsIntoPluginListInternal( | 31 void MockPluginList::LoadPluginsIntoPluginListInternal( |
| 40 std::vector<webkit::WebPluginInfo>* plugins) { | 32 std::vector<webkit::WebPluginInfo>* plugins) { |
| 41 for (size_t i = 0; i < plugins_to_load_.size(); ++i) { | 33 for (size_t i = 0; i < plugins_to_load_.size(); ++i) { |
| 42 plugins->push_back(plugins_to_load_[i]); | 34 plugins->push_back(plugins_to_load_[i]); |
| 43 } | 35 } |
| 44 } | 36 } |
| 45 | 37 |
| 46 } // npapi | 38 } // npapi |
| 47 } // webkit | 39 } // webkit |
| OLD | NEW |