OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/sha1.h" | 9 #include "base/sha1.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
11 #include "base/string_split.h" | 11 #include "base/string_split.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | 241 LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
242 << "Considering " << info.path.value() << " (" << info.name << ")"; | 242 << "Considering " << info.path.value() << " (" << info.name << ")"; |
243 | 243 |
244 if (IsUndesirablePlugin(info)) { | 244 if (IsUndesirablePlugin(info)) { |
245 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | 245 LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
246 << info.path.value() << " is undesirable."; | 246 << info.path.value() << " is undesirable."; |
247 | 247 |
248 // See if we have a better version of this plugin. | 248 // See if we have a better version of this plugin. |
249 for (size_t i = 0; i < plugin_groups->size(); ++i) { | 249 for (size_t i = 0; i < plugin_groups->size(); ++i) { |
250 const std::vector<WebPluginInfo>& plugins = | 250 const std::vector<WebPluginInfo>& plugins = |
251 (*plugin_groups)[i]->web_plugin_infos(); | 251 (*plugin_groups)[i]->web_plugins_info(); |
252 for (size_t j = 0; j < plugins.size(); ++j) { | 252 for (size_t j = 0; j < plugins.size(); ++j) { |
253 if (plugins[j].name == info.name && | 253 if (plugins[j].name == info.name && |
254 !IsUndesirablePlugin(plugins[j])) { | 254 !IsUndesirablePlugin(plugins[j])) { |
255 // Skip the current undesirable one so we can use the better one | 255 // Skip the current undesirable one so we can use the better one |
256 // we just found. | 256 // we just found. |
257 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | 257 LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
258 << "Skipping " << info.path.value() << ", preferring " | 258 << "Skipping " << info.path.value() << ", preferring " |
259 << plugins[j].path.value(); | 259 << plugins[j].path.value(); |
260 return false; | 260 return false; |
261 } | 261 } |
262 } | 262 } |
263 } | 263 } |
264 } | 264 } |
265 | 265 |
266 // TODO(evanm): prefer the newest version of flash, etc. here? | 266 // TODO(evanm): prefer the newest version of flash, etc. here? |
267 | 267 |
268 VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value(); | 268 VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value(); |
269 | 269 |
270 return true; | 270 return true; |
271 } | 271 } |
272 | 272 |
273 } // namespace npapi | 273 } // namespace npapi |
274 } // namespace webkit | 274 } // namespace webkit |
OLD | NEW |