blob: 9120a823e5164e87d83c6dc7597f039d4dbdb06b [file] [log] [blame]
[email protected]0dd9e8b2012-01-04 13:36:161// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]f99c87d2011-12-02 02:28:122// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]0f5e57f52012-09-20 20:53:185#ifndef CHROME_BROWSER_PLUGINS_PLUGIN_INSTALLER_H_
6#define CHROME_BROWSER_PLUGINS_PLUGIN_INSTALLER_H_
[email protected]f99c87d2011-12-02 02:28:127
[email protected]8ab03982014-04-23 22:15:128#include "base/gtest_prod_util.h"
avib896c712015-12-26 02:10:439#include "base/macros.h"
[email protected]0dd9e8b2012-01-04 13:36:1610#include "base/observer_list.h"
[email protected]c5e4a2222014-01-03 16:06:1311#include "base/version.h"
[email protected]de75c702012-09-25 23:06:0212#include "chrome/browser/plugins/plugin_metadata.h"
[email protected]761fa4702013-07-02 15:25:1513#include "url/gurl.h"
[email protected]f99c87d2011-12-02 02:28:1214
[email protected]0dd9e8b2012-01-04 13:36:1615class PluginInstallerObserver;
[email protected]3240d2502012-01-26 17:00:3316class WeakPluginInstallerObserver;
[email protected]0dd9e8b2012-01-04 13:36:1617
[email protected]27c483892012-02-09 15:59:1018namespace content {
[email protected]27c483892012-02-09 15:59:1019class WebContents;
[email protected]9f230ed2012-05-24 11:19:4020}
21
bauerbecab4f52017-03-13 20:16:4122class PluginInstaller {
[email protected]f99c87d2011-12-02 02:28:1223 public:
[email protected]fb745cf2012-10-02 15:33:4824 PluginInstaller();
Peter Boström53c6c5952021-09-17 09:41:2625
26 PluginInstaller(const PluginInstaller&) = delete;
27 PluginInstaller& operator=(const PluginInstaller&) = delete;
28
bauerbecab4f52017-03-13 20:16:4129 ~PluginInstaller();
[email protected]f99c87d2011-12-02 02:28:1230
[email protected]0dd9e8b2012-01-04 13:36:1631 void AddObserver(PluginInstallerObserver* observer);
32 void RemoveObserver(PluginInstallerObserver* observer);
33
[email protected]3240d2502012-01-26 17:00:3334 void AddWeakObserver(WeakPluginInstallerObserver* observer);
35 void RemoveWeakObserver(WeakPluginInstallerObserver* observer);
36
[email protected]314bb482012-10-05 17:07:3237 // Opens the download URL in a new tab.
38 void OpenDownloadURL(const GURL& plugin_url,
[email protected]fb745cf2012-10-02 15:33:4839 content::WebContents* web_contents);
[email protected]0dd9e8b2012-01-04 13:36:1640
[email protected]f99c87d2011-12-02 02:28:1241 private:
[email protected]8ab03982014-04-23 22:15:1242 FRIEND_TEST_ALL_PREFIXES(PluginInstallerTest,
43 StartInstalling_SuccessfulDownload);
44 FRIEND_TEST_ALL_PREFIXES(PluginInstallerTest, StartInstalling_FailedStart);
45 FRIEND_TEST_ALL_PREFIXES(PluginInstallerTest, StartInstalling_Interrupted);
bauerbecab4f52017-03-13 20:16:4146
Trent Apteda250ec3ab2018-08-19 08:52:1947 base::ObserverList<PluginInstallerObserver>::Unchecked observers_;
bauerbecab4f52017-03-13 20:16:4148 int strong_observer_count_;
Trent Apteda250ec3ab2018-08-19 08:52:1949 base::ObserverList<WeakPluginInstallerObserver>::Unchecked weak_observers_;
[email protected]f99c87d2011-12-02 02:28:1250};
51
[email protected]0f5e57f52012-09-20 20:53:1852#endif // CHROME_BROWSER_PLUGINS_PLUGIN_INSTALLER_H_