Index: chrome/browser/plugin_installer.h |
diff --git a/chrome/browser/plugin_installer.h b/chrome/browser/plugin_installer.h |
index bd2606d1d33e0cd5ceabf1ac4df61bdf97624ef7..a5854e86e08f8ec352c41bcac7d31110b4667592 100644 |
--- a/chrome/browser/plugin_installer.h |
+++ b/chrome/browser/plugin_installer.h |
@@ -44,7 +44,8 @@ class PluginInstaller : public content::DownloadItem::Observer { |
const string16& name, |
bool url_for_display, |
const GURL& plugin_url, |
- const GURL& help_url); |
+ const GURL& help_url, |
+ const string16& group_name_matcher); |
virtual ~PluginInstaller(); |
virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
@@ -62,6 +63,9 @@ class PluginInstaller : public content::DownloadItem::Observer { |
// Human-readable name of the plug-in. |
const string16& name() const { return name_; } |
+ // A substring used in matching similar plug-ins. |
+ const string16& group_name_matcher() const { return group_name_matcher_; } |
+ |
// If |url_for_display| is false, |plugin_url| is the URL of the download page |
// for the plug-in, which should be opened in a new tab. If it is true, |
// |plugin_url| is the URL of the plug-in installer binary, which can be |
@@ -95,6 +99,14 @@ class PluginInstaller : public content::DownloadItem::Observer { |
static bool ParseSecurityStatus(const std::string& status_str, |
SecurityStatus* status); |
+ // Returns matcher part of configured plug-in group names, |
+ // or the filename without extension if the name is empty. |
+ static string16 GetGroupName(const webkit::WebPluginInfo& plugin); |
+ |
+ // Generates the (short) identifier string for the given plug-in. |
+ // It searches in configured plug-in groups first, and returns the identifier |
+ // if a match was found, otherwise it uses the base name of the file path. |
+ static std::string GetIdentifier(const webkit::WebPluginInfo& plugin); |
private: |
struct VersionComparator { |
bool operator() (const Version& lhs, const Version& rhs) const; |
@@ -105,9 +117,12 @@ class PluginInstaller : public content::DownloadItem::Observer { |
net::Error error); |
void DownloadError(const std::string& msg); |
void DownloadCancelled(); |
+ static PluginInstaller* MatchWithConfiguredPlugins( |
+ const webkit::WebPluginInfo& plugin); |
std::string identifier_; |
string16 name_; |
+ string16 group_name_matcher_; |
bool url_for_display_; |
GURL plugin_url_; |
GURL help_url_; |