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

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 // Plug-in group name.
67 const string16& group_name() const { return group_name_; }
68
69 // Sets |group_name_|
70 void set_group_name(const string16& group_name) { group_name_ = group_name; }
Bernhard Bauer 2012/08/22 15:11:30 We don't really need a separate "group name" anymo
ibraaaa 2012/08/22 18:29:25 That is what I am doing. If you checked how the gr
Bernhard Bauer 2012/08/22 19:45:57 What I meant was that there is no reason to have b
ibraaaa 2012/08/23 08:35:55 Done.
71
72 // Plug-in group name substring used in matching plug-ins of the same group.
73 const string16& group_name_matcher() const { return group_name_matcher_; }
Bernhard Bauer 2012/08/22 15:11:30 It might be nice to just have a public method that
ibraaaa 2012/08/22 18:29:25 LIKE, I mean +1 :) On 2012/08/22 15:11:30, Bernha
74
65 // If |url_for_display| is false, |plugin_url| is the URL of the download page 75 // 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, 76 // 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 77 // |plugin_url| is the URL of the plug-in installer binary, which can be
68 // directly downloaded. 78 // directly downloaded.
69 bool url_for_display() const { return url_for_display_; } 79 bool url_for_display() const { return url_for_display_; }
70 const GURL& plugin_url() const { return plugin_url_; } 80 const GURL& plugin_url() const { return plugin_url_; }
71 81
72 // URL to open when the user clicks on the "Problems installing?" link. 82 // URL to open when the user clicks on the "Problems installing?" link.
73 const GURL& help_url() const { return help_url_; } 83 const GURL& help_url() const { return help_url_; }
74 84
(...skipping 26 matching lines...) Expand all
101 }; 111 };
102 112
103 void DownloadStarted(scoped_refptr<content::DownloadManager> dlm, 113 void DownloadStarted(scoped_refptr<content::DownloadManager> dlm,
104 content::DownloadId download_id, 114 content::DownloadId download_id,
105 net::Error error); 115 net::Error error);
106 void DownloadError(const std::string& msg); 116 void DownloadError(const std::string& msg);
107 void DownloadCancelled(); 117 void DownloadCancelled();
108 118
109 std::string identifier_; 119 std::string identifier_;
110 string16 name_; 120 string16 name_;
121 string16 group_name_;
122 string16 group_name_matcher_;
111 bool url_for_display_; 123 bool url_for_display_;
112 GURL plugin_url_; 124 GURL plugin_url_;
113 GURL help_url_; 125 GURL help_url_;
114 std::map<Version, SecurityStatus, VersionComparator> versions_; 126 std::map<Version, SecurityStatus, VersionComparator> versions_;
115 127
116 InstallerState state_; 128 InstallerState state_;
117 ObserverList<PluginInstallerObserver> observers_; 129 ObserverList<PluginInstallerObserver> observers_;
118 ObserverList<WeakPluginInstallerObserver> weak_observers_; 130 ObserverList<WeakPluginInstallerObserver> weak_observers_;
119 131
120 DISALLOW_COPY_AND_ASSIGN(PluginInstaller); 132 DISALLOW_COPY_AND_ASSIGN(PluginInstaller);
121 }; 133 };
122 134
123 #endif // CHROME_BROWSER_PLUGIN_INSTALLER_H_ 135 #endif // CHROME_BROWSER_PLUGIN_INSTALLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698