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

Unified Diff: chrome/browser/plugin_installer.h

Issue 10823434: [6] Moves CreateVersionFromString to plugin_utils and updates the callers. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 2nd CL in series to delete PluginGroup. Created 8 years, 4 months 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: chrome/browser/plugin_installer.h
diff --git a/chrome/browser/plugin_installer.h b/chrome/browser/plugin_installer.h
index bd2606d1d33e0cd5ceabf1ac4df61bdf97624ef7..96ebbda567f08f24435af81d37d5a030af8ddafc 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,20 @@ 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);
+
+ // Gets the plug-in group name using the plug-in identifier.
+ static string16 GetGroupNameByIdentifier(
+ const std::vector<webkit::WebPluginInfo>& plugins,
+ const std::string& identifier);
+
private:
struct VersionComparator {
bool operator() (const Version& lhs, const Version& rhs) const;
@@ -105,9 +123,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_;

Powered by Google App Engine
This is Rietveld 408576698