Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Unified Diff: webkit/glue/plugins/plugin_list_mac.mm

Issue 5699005: Policy: Re-enabled plugin still disabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MacOS support patched in. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/glue/plugins/plugin_list_mac.mm
diff --git a/webkit/glue/plugins/plugin_list_mac.mm b/webkit/glue/plugins/plugin_list_mac.mm
index 6e5019dd2f7a214f7a642a3b507987492e2810a8..6c6782c492f1803931da2c19c582397a5a6e3021 100644
--- a/webkit/glue/plugins/plugin_list_mac.mm
+++ b/webkit/glue/plugins/plugin_list_mac.mm
@@ -63,20 +63,18 @@ void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) {
}
void PluginList::LoadPluginsFromDir(const FilePath &path,
- std::vector<WebPluginInfo>* plugins,
std::set<FilePath>* visited_plugins) {
file_util::FileEnumerator enumerator(path,
false, // not recursive
file_util::FileEnumerator::DIRECTORIES);
for (FilePath path = enumerator.Next(); !path.value().empty();
path = enumerator.Next()) {
- LoadPlugin(path, plugins);
+ LoadPlugin(path);
visited_plugins->insert(path);
}
}
-bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info,
- std::vector<WebPluginInfo>* plugins) {
+bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info) {
if (IsBlacklistedPlugin(info))
return false;
@@ -86,14 +84,22 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info,
// to enable it.
if (StartsWith(info.name, ASCIIToUTF16("Flip4Mac Windows Media Plugin"),
false))
- DisablePlugin(info.path);
+ DisablePlugin(info.path, true);
// Hierarchy check
// (we're loading plugins hierarchically from Library folders, so plugins we
// encounter earlier must override plugins we encounter later)
- for (size_t i = 0; i < plugins->size(); ++i) {
- if ((*plugins)[i].path.BaseName() == info.path.BaseName()) {
- return false; // We already have a loaded plugin higher in the hierarchy.
+ std::vector<WebPluginInfo*> new_plugins;
+ for (PluginGroup::PluginMap::iterator it = plugin_groups_.begin();
+ it != plugin_groups_.end(); ++it) {
+ std::vector<WebPluginInfo>& group_plugins = it->second->GetPlugins();
+ for (std::vector<WebPluginInfo>::iterator itp = group_plugins.begin();
+ itp != group_plugins.end();
+ ++itp) {
+ if (itp->path.BaseName() == info.path.BaseName()) {
+ // We already have a loaded plugin higher in the hierarchy.
+ return false;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698