diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-05 00:45:38 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-05 00:45:38 +0000 |
commit | e346424b21e6471741d0a54b3576597c680797b5 (patch) | |
tree | 858a6205592bea52013bf09d4bff73410c6b5da6 /content | |
parent | ef15764accfab4c330a913bef71370e146a9b2f0 (diff) | |
download | chromium_src-e346424b21e6471741d0a54b3576597c680797b5.zip chromium_src-e346424b21e6471741d0a54b3576597c680797b5.tar.gz chromium_src-e346424b21e6471741d0a54b3576597c680797b5.tar.bz2 |
Return a list of plugins that support clearing site data instead of the first one.
BUG=126089
TEST=see bug for manual test
Review URL: http://codereview.chromium.org/10351013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135497 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/plugin_data_remover_impl.cc | 19 | ||||
-rw-r--r-- | content/public/browser/plugin_data_remover.h | 9 |
2 files changed, 14 insertions, 14 deletions
diff --git a/content/browser/plugin_data_remover_impl.cc b/content/browser/plugin_data_remover_impl.cc index a6d1479..be082c1 100644 --- a/content/browser/plugin_data_remover_impl.cc +++ b/content/browser/plugin_data_remover_impl.cc @@ -39,22 +39,21 @@ PluginDataRemover* PluginDataRemover::Create(BrowserContext* browser_context) { } // static -bool PluginDataRemover::IsSupported(webkit::WebPluginInfo* plugin) { +void PluginDataRemover::GetSupportedPlugins( + std::vector<webkit::WebPluginInfo>* supported_plugins) { bool allow_wildcard = false; std::vector<webkit::WebPluginInfo> plugins; PluginService::GetInstance()->GetPluginInfoArray( GURL(), kFlashMimeType, allow_wildcard, &plugins, NULL); - std::vector<webkit::WebPluginInfo>::iterator plugin_it = plugins.begin(); - if (plugin_it == plugins.end()) - return false; - scoped_ptr<Version> version( - webkit::npapi::PluginGroup::CreateVersionFromString(plugin_it->version)); scoped_ptr<Version> min_version( Version::GetVersionFromString(kMinFlashVersion)); - bool rv = version.get() && min_version->CompareTo(*version) == -1; - if (rv) - *plugin = *plugin_it; - return rv; + for (std::vector<webkit::WebPluginInfo>::iterator it = plugins.begin(); + it != plugins.end(); ++it) { + scoped_ptr<Version> version( + webkit::npapi::PluginGroup::CreateVersionFromString(it->version)); + if (version.get() && min_version->CompareTo(*version) == -1) + supported_plugins->push_back(*it); + } } class PluginDataRemoverImpl::Context diff --git a/content/public/browser/plugin_data_remover.h b/content/public/browser/plugin_data_remover.h index 88aeaee..06a68fe 100644 --- a/content/public/browser/plugin_data_remover.h +++ b/content/public/browser/plugin_data_remover.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,6 +6,8 @@ #define CONTENT_PUBLIC_BROWSER_PLUGIN_DATA_REMOVER_H_ #pragma once +#include <vector> + #include "base/time.h" #include "content/common/content_export.h" @@ -29,11 +31,10 @@ class CONTENT_EXPORT PluginDataRemover { // Starts removing plug-in data stored since |begin_time|. virtual base::WaitableEvent* StartRemoving(base::Time begin_time) = 0; - // Returns whether there is a plug-in installed that supports removing LSO - // data. If it returns true |plugin| is also set to that plugin. This method + // Returns a list of all plug-ins that support removing LSO data. This method // will use cached plugin data. Call PluginService::GetPlugins() if the latest // data is needed. - static bool IsSupported(webkit::WebPluginInfo* plugin); + static void GetSupportedPlugins(std::vector<webkit::WebPluginInfo>* plugins); }; } // namespace content |