Popular sites on the NTP: re-download popular suggestions once per Chrome run
[chromium-blink-merge.git] / chrome / browser / plugins / plugin_installer_observer.h
blob58c5e89f918802624792ff793e60e9286cc7fcce
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_
8 #include <string>
10 class PluginInstaller;
12 class PluginInstallerObserver {
13 public:
14 explicit PluginInstallerObserver(PluginInstaller* installer);
15 virtual ~PluginInstallerObserver();
17 protected:
18 PluginInstaller* installer() const { return installer_; }
20 private:
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 {
36 public:
37 explicit WeakPluginInstallerObserver(PluginInstaller* installer);
38 ~WeakPluginInstallerObserver() override;
40 private:
41 friend class PluginInstaller;
43 virtual void OnlyWeakObserversLeft();
46 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_INSTALLER_OBSERVER_H_