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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PLUGINS_PLUGIN_INSTALLER_OBSERVER_H_
6 #define CHROME_BROWSER_PLUGINS_PLUGIN_INSTALLER_OBSERVER_H_
10 class PluginInstaller
;
12 class PluginInstallerObserver
{
14 explicit PluginInstallerObserver(PluginInstaller
* installer
);
15 virtual ~PluginInstallerObserver();
18 PluginInstaller
* installer() const { return installer_
; }
21 friend class PluginInstaller
;
23 virtual void DownloadStarted();
24 virtual void DownloadFinished();
25 virtual void DownloadError(const std::string
& message
);
26 virtual void DownloadCancelled();
28 // Weak pointer; Owned by PluginFinder, which is a singleton.
29 PluginInstaller
* installer_
;
32 // A WeakPluginInstallerObserver is like a weak pointer to the installer, in the
33 // sense that if only weak observers are left, we don't need to show
34 // installation UI anymore.
35 class WeakPluginInstallerObserver
: public PluginInstallerObserver
{
37 explicit WeakPluginInstallerObserver(PluginInstaller
* installer
);
38 ~WeakPluginInstallerObserver() override
;
41 friend class PluginInstaller
;
43 virtual void OnlyWeakObserversLeft();
46 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_INSTALLER_OBSERVER_H_