OLD | NEW |
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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 public: | 26 public: |
27 enum State { | 27 enum State { |
28 kStateIdle, | 28 kStateIdle, |
29 kStateDownloading, | 29 kStateDownloading, |
30 }; | 30 }; |
31 | 31 |
32 PluginInstaller(const std::string& identifier, | 32 PluginInstaller(const std::string& identifier, |
33 const GURL& plugin_url, | 33 const GURL& plugin_url, |
34 const GURL& help_url, | 34 const GURL& help_url, |
35 const string16& name, | 35 const string16& name, |
36 bool url_for_display, | 36 bool url_for_display); |
37 bool requires_authorization); | |
38 virtual ~PluginInstaller(); | 37 virtual ~PluginInstaller(); |
39 | 38 |
40 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 39 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
41 | 40 |
42 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; | 41 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; |
43 | 42 |
44 void AddObserver(PluginInstallerObserver* observer); | 43 void AddObserver(PluginInstallerObserver* observer); |
45 void RemoveObserver(PluginInstallerObserver* observer); | 44 void RemoveObserver(PluginInstallerObserver* observer); |
46 | 45 |
47 void AddWeakObserver(WeakPluginInstallerObserver* observer); | 46 void AddWeakObserver(WeakPluginInstallerObserver* observer); |
48 void RemoveWeakObserver(WeakPluginInstallerObserver* observer); | 47 void RemoveWeakObserver(WeakPluginInstallerObserver* observer); |
49 | 48 |
50 State state() const { return state_; } | 49 State state() const { return state_; } |
51 | 50 |
52 // Unique identifier for the plug-in. Should be kept in sync with the | 51 // Unique identifier for the plug-in. Should be kept in sync with the |
53 // identifier in plugin_list.cc. | 52 // identifier in plugin_list.cc. |
54 const std::string& identifier() const { return identifier_; } | 53 const std::string& identifier() const { return identifier_; } |
55 | 54 |
56 // Human-readable name of the plug-in. | 55 // Human-readable name of the plug-in. |
57 const string16& name() const { return name_; } | 56 const string16& name() const { return name_; } |
58 | 57 |
59 // Whether the plug-in requires user authorization to run. | |
60 bool requires_authorization() const { return requires_authorization_; } | |
61 | |
62 // If |url_for_display| is false, |plugin_url| is the URL of the download page | 58 // If |url_for_display| is false, |plugin_url| is the URL of the download page |
63 // for the plug-in, which should be opened in a new tab. If it is true, | 59 // for the plug-in, which should be opened in a new tab. If it is true, |
64 // |plugin_url| is the URL of the plug-in installer binary, which can be | 60 // |plugin_url| is the URL of the plug-in installer binary, which can be |
65 // directly downloaded. | 61 // directly downloaded. |
66 bool url_for_display() const { return url_for_display_; } | 62 bool url_for_display() const { return url_for_display_; } |
67 const GURL& plugin_url() const { return plugin_url_; } | 63 const GURL& plugin_url() const { return plugin_url_; } |
68 | 64 |
69 // URL to open when the user clicks on the "Problems installing?" link. | 65 // URL to open when the user clicks on the "Problems installing?" link. |
70 const GURL& help_url() const { return help_url_; } | 66 const GURL& help_url() const { return help_url_; } |
71 | 67 |
(...skipping 15 matching lines...) Expand all Loading... |
87 | 83 |
88 State state_; | 84 State state_; |
89 ObserverList<PluginInstallerObserver> observers_; | 85 ObserverList<PluginInstallerObserver> observers_; |
90 ObserverList<WeakPluginInstallerObserver> weak_observers_; | 86 ObserverList<WeakPluginInstallerObserver> weak_observers_; |
91 | 87 |
92 std::string identifier_; | 88 std::string identifier_; |
93 GURL plugin_url_; | 89 GURL plugin_url_; |
94 GURL help_url_; | 90 GURL help_url_; |
95 string16 name_; | 91 string16 name_; |
96 bool url_for_display_; | 92 bool url_for_display_; |
97 bool requires_authorization_; | |
98 | 93 |
99 DISALLOW_COPY_AND_ASSIGN(PluginInstaller); | 94 DISALLOW_COPY_AND_ASSIGN(PluginInstaller); |
100 }; | 95 }; |
101 | 96 |
102 #endif // CHROME_BROWSER_PLUGIN_INSTALLER_H_ | 97 #endif // CHROME_BROWSER_PLUGIN_INSTALLER_H_ |
OLD | NEW |