Index: webkit/plugins/npapi/plugin_list_posix.cc |
diff --git a/webkit/plugins/npapi/plugin_list_posix.cc b/webkit/plugins/npapi/plugin_list_posix.cc |
index ed475ff028f521977435bf20966b61cc85088b43..974a42361aee4da66698527728f96aeb29cd0e54 100644 |
--- a/webkit/plugins/npapi/plugin_list_posix.cc |
+++ b/webkit/plugins/npapi/plugin_list_posix.cc |
@@ -266,6 +266,7 @@ void PluginList::GetPluginsInDir( |
} |
} |
+// TODO(ibraaaa): DELETE. http://crbug.com/124396 |
bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, |
ScopedVector<PluginGroup>* plugin_groups) { |
LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
@@ -300,5 +301,35 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, |
return true; |
} |
+bool PluginList::ShouldLoadPluginUsingPluginList( |
+ const WebPluginInfo& info, std::vector<webkit::WebPluginInfo>* plugins) { |
+ LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
+ << "Considering " << info.path.value() << " (" << info.name << ")"; |
+ |
+ if (IsUndesirablePlugin(info)) { |
+ LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
+ << info.path.value() << " is undesirable."; |
+ |
+ // See if we have a better version of this plugin. |
+ for (size_t j = 0; j < plugins->size(); ++j) { |
+ if ((*plugins)[j].name == info.name && |
+ !IsUndesirablePlugin((*plugins)[j])) { |
+ // Skip the current undesirable one so we can use the better one |
+ // we just found. |
+ LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
+ << "Skipping " << info.path.value() << ", preferring " |
+ << (*plugins)[j].path.value(); |
+ return false; |
+ } |
+ } |
+ } |
+ |
+ // TODO(evanm): prefer the newest version of flash, etc. here? |
+ |
+ VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value(); |
+ |
+ return true; |
+} |
+ |
} // namespace npapi |
} // namespace webkit |