| 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 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, | 100 bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, |
| 101 ScopedVector<PluginGroup>* plugin_groups) { | 101 ScopedVector<PluginGroup>* plugin_groups) { |
| 102 if (IsBlacklistedPlugin(info)) | 102 if (IsBlacklistedPlugin(info)) |
| 103 return false; | 103 return false; |
| 104 | 104 |
| 105 // Hierarchy check | 105 // Hierarchy check |
| 106 // (we're loading plugins hierarchically from Library folders, so plugins we | 106 // (we're loading plugins hierarchically from Library folders, so plugins we |
| 107 // encounter earlier must override plugins we encounter later) | 107 // encounter earlier must override plugins we encounter later) |
| 108 for (size_t i = 0; i < plugin_groups->size(); ++i) { | 108 for (size_t i = 0; i < plugin_groups->size(); ++i) { |
| 109 const std::vector<WebPluginInfo>& plugins = | 109 const std::vector<WebPluginInfo>& plugins = |
| 110 (*plugin_groups)[i]->web_plugin_infos(); | 110 (*plugin_groups)[i]->web_plugins_info(); |
| 111 for (size_t j = 0; j < plugins.size(); ++j) { | 111 for (size_t j = 0; j < plugins.size(); ++j) { |
| 112 if (plugins[j].path.BaseName() == info.path.BaseName()) { | 112 if (plugins[j].path.BaseName() == info.path.BaseName()) { |
| 113 return false; // Already have a loaded plugin higher in the hierarchy. | 113 return false; // Already have a loaded plugin higher in the hierarchy. |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 return true; | 118 return true; |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace npapi | 121 } // namespace npapi |
| 122 } // namespace webkit | 122 } // namespace webkit |
| OLD | NEW |