[email protected] | 0dd9e8b | 2012-01-04 13:36:16 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | f99c87d | 2011-12-02 02:28:12 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 0f5e57f5 | 2012-09-20 20:53:18 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_PLUGINS_PLUGIN_INSTALLER_H_ |
6 | #define CHROME_BROWSER_PLUGINS_PLUGIN_INSTALLER_H_ | ||||
[email protected] | f99c87d | 2011-12-02 02:28:12 | [diff] [blame] | 7 | |
[email protected] | 8ab0398 | 2014-04-23 22:15:12 | [diff] [blame] | 8 | #include "base/gtest_prod_util.h" |
avi | b896c71 | 2015-12-26 02:10:43 | [diff] [blame] | 9 | #include "base/macros.h" |
[email protected] | 0dd9e8b | 2012-01-04 13:36:16 | [diff] [blame] | 10 | #include "base/observer_list.h" |
[email protected] | c5e4a222 | 2014-01-03 16:06:13 | [diff] [blame] | 11 | #include "base/version.h" |
[email protected] | de75c70 | 2012-09-25 23:06:02 | [diff] [blame] | 12 | #include "chrome/browser/plugins/plugin_metadata.h" |
[email protected] | 761fa470 | 2013-07-02 15:25:15 | [diff] [blame] | 13 | #include "url/gurl.h" |
[email protected] | f99c87d | 2011-12-02 02:28:12 | [diff] [blame] | 14 | |
[email protected] | 0dd9e8b | 2012-01-04 13:36:16 | [diff] [blame] | 15 | class PluginInstallerObserver; |
[email protected] | 3240d250 | 2012-01-26 17:00:33 | [diff] [blame] | 16 | class WeakPluginInstallerObserver; |
[email protected] | 0dd9e8b | 2012-01-04 13:36:16 | [diff] [blame] | 17 | |
[email protected] | 27c48389 | 2012-02-09 15:59:10 | [diff] [blame] | 18 | namespace content { |
[email protected] | 27c48389 | 2012-02-09 15:59:10 | [diff] [blame] | 19 | class WebContents; |
[email protected] | 9f230ed | 2012-05-24 11:19:40 | [diff] [blame] | 20 | } |
21 | |||||
bauerb | ecab4f5 | 2017-03-13 20:16:41 | [diff] [blame] | 22 | class PluginInstaller { |
[email protected] | f99c87d | 2011-12-02 02:28:12 | [diff] [blame] | 23 | public: |
[email protected] | fb745cf | 2012-10-02 15:33:48 | [diff] [blame] | 24 | PluginInstaller(); |
Peter Boström | 53c6c595 | 2021-09-17 09:41:26 | [diff] [blame^] | 25 | |
26 | PluginInstaller(const PluginInstaller&) = delete; | ||||
27 | PluginInstaller& operator=(const PluginInstaller&) = delete; | ||||
28 | |||||
bauerb | ecab4f5 | 2017-03-13 20:16:41 | [diff] [blame] | 29 | ~PluginInstaller(); |
[email protected] | f99c87d | 2011-12-02 02:28:12 | [diff] [blame] | 30 | |
[email protected] | 0dd9e8b | 2012-01-04 13:36:16 | [diff] [blame] | 31 | void AddObserver(PluginInstallerObserver* observer); |
32 | void RemoveObserver(PluginInstallerObserver* observer); | ||||
33 | |||||
[email protected] | 3240d250 | 2012-01-26 17:00:33 | [diff] [blame] | 34 | void AddWeakObserver(WeakPluginInstallerObserver* observer); |
35 | void RemoveWeakObserver(WeakPluginInstallerObserver* observer); | ||||
36 | |||||
[email protected] | 314bb48 | 2012-10-05 17:07:32 | [diff] [blame] | 37 | // Opens the download URL in a new tab. |
38 | void OpenDownloadURL(const GURL& plugin_url, | ||||
[email protected] | fb745cf | 2012-10-02 15:33:48 | [diff] [blame] | 39 | content::WebContents* web_contents); |
[email protected] | 0dd9e8b | 2012-01-04 13:36:16 | [diff] [blame] | 40 | |
[email protected] | f99c87d | 2011-12-02 02:28:12 | [diff] [blame] | 41 | private: |
[email protected] | 8ab0398 | 2014-04-23 22:15:12 | [diff] [blame] | 42 | FRIEND_TEST_ALL_PREFIXES(PluginInstallerTest, |
43 | StartInstalling_SuccessfulDownload); | ||||
44 | FRIEND_TEST_ALL_PREFIXES(PluginInstallerTest, StartInstalling_FailedStart); | ||||
45 | FRIEND_TEST_ALL_PREFIXES(PluginInstallerTest, StartInstalling_Interrupted); | ||||
bauerb | ecab4f5 | 2017-03-13 20:16:41 | [diff] [blame] | 46 | |
Trent Apted | a250ec3ab | 2018-08-19 08:52:19 | [diff] [blame] | 47 | base::ObserverList<PluginInstallerObserver>::Unchecked observers_; |
bauerb | ecab4f5 | 2017-03-13 20:16:41 | [diff] [blame] | 48 | int strong_observer_count_; |
Trent Apted | a250ec3ab | 2018-08-19 08:52:19 | [diff] [blame] | 49 | base::ObserverList<WeakPluginInstallerObserver>::Unchecked weak_observers_; |
[email protected] | f99c87d | 2011-12-02 02:28:12 | [diff] [blame] | 50 | }; |
51 | |||||
[email protected] | 0f5e57f5 | 2012-09-20 20:53:18 | [diff] [blame] | 52 | #endif // CHROME_BROWSER_PLUGINS_PLUGIN_INSTALLER_H_ |