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/plugin_list.h" | 5 #include "webkit/plugins/npapi/plugin_list.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 plugin_groups_[i]->web_plugin_infos()[0]; | 590 plugin_groups_[i]->web_plugin_infos()[0]; |
591 if (SupportsType(default_info, mime_type, allow_wildcard)) { | 591 if (SupportsType(default_info, mime_type, allow_wildcard)) { |
592 info->push_back(default_info); | 592 info->push_back(default_info); |
593 if (actual_mime_types) | 593 if (actual_mime_types) |
594 actual_mime_types->push_back(mime_type); | 594 actual_mime_types->push_back(mime_type); |
595 } | 595 } |
596 } | 596 } |
597 } | 597 } |
598 } | 598 } |
599 | 599 |
600 bool PluginList::GetPluginInfoByPath(const FilePath& plugin_path, | |
601 webkit::WebPluginInfo* info) { | |
602 LoadPlugins(); | |
603 base::AutoLock lock(lock_); | |
604 for (size_t i = 0; i < plugin_groups_.size(); ++i) { | |
605 const std::vector<webkit::WebPluginInfo>& plugins = | |
606 plugin_groups_[i]->web_plugin_infos(); | |
607 for (size_t i = 0; i < plugins.size(); ++i) { | |
608 if (plugins[i].path == plugin_path) { | |
609 *info = plugins[i]; | |
610 return true; | |
611 } | |
612 } | |
613 } | |
614 | |
615 return false; | |
616 } | |
617 | |
618 void PluginList::GetPluginGroups( | 600 void PluginList::GetPluginGroups( |
619 bool load_if_necessary, | 601 bool load_if_necessary, |
620 std::vector<PluginGroup>* plugin_groups) { | 602 std::vector<PluginGroup>* plugin_groups) { |
621 if (load_if_necessary) | 603 if (load_if_necessary) |
622 LoadPlugins(); | 604 LoadPlugins(); |
623 base::AutoLock lock(lock_); | 605 base::AutoLock lock(lock_); |
624 plugin_groups->clear(); | 606 plugin_groups->clear(); |
625 for (size_t i = 0; i < plugin_groups_.size(); ++i) { | 607 for (size_t i = 0; i < plugin_groups_.size(); ++i) { |
626 // In some unit tests we can get confronted with empty groups but in real | 608 // In some unit tests we can get confronted with empty groups but in real |
627 // world code this if should never be false here. | 609 // world code this if should never be false here. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 } | 710 } |
729 return false; | 711 return false; |
730 } | 712 } |
731 | 713 |
732 PluginList::~PluginList() { | 714 PluginList::~PluginList() { |
733 } | 715 } |
734 | 716 |
735 | 717 |
736 } // namespace npapi | 718 } // namespace npapi |
737 } // namespace webkit | 719 } // namespace webkit |
OLD | NEW |