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

Side by Side Diff: chrome/browser/plugin_installer.h

Issue 10881002: [2] Adding a method to PluginFinder to get a PluginInstaller by WebPluginInfo. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding a method to PluginFinder to get a PluginInstaller by WebPluginInfo. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_PLUGIN_INSTALLER_H_ 5 #ifndef CHROME_BROWSER_PLUGIN_INSTALLER_H_
6 #define CHROME_BROWSER_PLUGIN_INSTALLER_H_ 6 #define CHROME_BROWSER_PLUGIN_INSTALLER_H_
7 7
8 #include "base/observer_list.h" 8 #include "base/observer_list.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/version.h" 10 #include "base/version.h"
(...skipping 26 matching lines...) Expand all
37 enum SecurityStatus { 37 enum SecurityStatus {
38 SECURITY_STATUS_UP_TO_DATE, 38 SECURITY_STATUS_UP_TO_DATE,
39 SECURITY_STATUS_OUT_OF_DATE, 39 SECURITY_STATUS_OUT_OF_DATE,
40 SECURITY_STATUS_REQUIRES_AUTHORIZATION, 40 SECURITY_STATUS_REQUIRES_AUTHORIZATION,
41 }; 41 };
42 42
43 PluginInstaller(const std::string& identifier, 43 PluginInstaller(const std::string& identifier,
44 const string16& name, 44 const string16& name,
45 bool url_for_display, 45 bool url_for_display,
46 const GURL& plugin_url, 46 const GURL& plugin_url,
47 const GURL& help_url); 47 const GURL& help_url,
48 const string16& group_name_matcher);
48 virtual ~PluginInstaller(); 49 virtual ~PluginInstaller();
49 50
50 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; 51 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE;
51 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; 52 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE;
52 53
53 void AddObserver(PluginInstallerObserver* observer); 54 void AddObserver(PluginInstallerObserver* observer);
54 void RemoveObserver(PluginInstallerObserver* observer); 55 void RemoveObserver(PluginInstallerObserver* observer);
55 56
56 void AddWeakObserver(WeakPluginInstallerObserver* observer); 57 void AddWeakObserver(WeakPluginInstallerObserver* observer);
57 void RemoveWeakObserver(WeakPluginInstallerObserver* observer); 58 void RemoveWeakObserver(WeakPluginInstallerObserver* observer);
58 59
59 // Unique identifier for the plug-in. 60 // Unique identifier for the plug-in.
60 const std::string& identifier() const { return identifier_; } 61 const std::string& identifier() const { return identifier_; }
61 62
62 // Human-readable name of the plug-in. 63 // Human-readable name of the plug-in.
63 const string16& name() const { return name_; } 64 const string16& name() const { return name_; }
64 65
66 // Checks if the plug-in matches the group matcher.
67 bool IsPluginMatchingGroupMatcher(const webkit::WebPluginInfo& plugin);
Bernhard Bauer 2012/08/23 09:05:07 Nit: Just "MatchesPlugin()"?
ibraaaa 2012/08/23 09:58:33 Done.
68
65 // If |url_for_display| is false, |plugin_url| is the URL of the download page 69 // If |url_for_display| is false, |plugin_url| is the URL of the download page
66 // for the plug-in, which should be opened in a new tab. If it is true, 70 // for the plug-in, which should be opened in a new tab. If it is true,
67 // |plugin_url| is the URL of the plug-in installer binary, which can be 71 // |plugin_url| is the URL of the plug-in installer binary, which can be
68 // directly downloaded. 72 // directly downloaded.
69 bool url_for_display() const { return url_for_display_; } 73 bool url_for_display() const { return url_for_display_; }
70 const GURL& plugin_url() const { return plugin_url_; } 74 const GURL& plugin_url() const { return plugin_url_; }
71 75
72 // URL to open when the user clicks on the "Problems installing?" link. 76 // URL to open when the user clicks on the "Problems installing?" link.
73 const GURL& help_url() const { return help_url_; } 77 const GURL& help_url() const { return help_url_; }
74 78
(...skipping 26 matching lines...) Expand all
101 }; 105 };
102 106
103 void DownloadStarted(scoped_refptr<content::DownloadManager> dlm, 107 void DownloadStarted(scoped_refptr<content::DownloadManager> dlm,
104 content::DownloadId download_id, 108 content::DownloadId download_id,
105 net::Error error); 109 net::Error error);
106 void DownloadError(const std::string& msg); 110 void DownloadError(const std::string& msg);
107 void DownloadCancelled(); 111 void DownloadCancelled();
108 112
109 std::string identifier_; 113 std::string identifier_;
110 string16 name_; 114 string16 name_;
115 string16 group_name_matcher_;
111 bool url_for_display_; 116 bool url_for_display_;
112 GURL plugin_url_; 117 GURL plugin_url_;
113 GURL help_url_; 118 GURL help_url_;
114 std::map<Version, SecurityStatus, VersionComparator> versions_; 119 std::map<Version, SecurityStatus, VersionComparator> versions_;
115 120
116 InstallerState state_; 121 InstallerState state_;
117 ObserverList<PluginInstallerObserver> observers_; 122 ObserverList<PluginInstallerObserver> observers_;
118 ObserverList<WeakPluginInstallerObserver> weak_observers_; 123 ObserverList<WeakPluginInstallerObserver> weak_observers_;
119 124
120 DISALLOW_COPY_AND_ASSIGN(PluginInstaller); 125 DISALLOW_COPY_AND_ASSIGN(PluginInstaller);
121 }; 126 };
122 127
123 #endif // CHROME_BROWSER_PLUGIN_INSTALLER_H_ 128 #endif // CHROME_BROWSER_PLUGIN_INSTALLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698