• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 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.
4 
5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_
6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_
7 
8 #include <string>
9 
10 #include "ui/gfx/image/image_skia.h"
11 
12 namespace extensions {
13 
14 class Extension;
15 
16 class InstallObserver {
17  public:
18   struct ExtensionInstallParams {
19     ExtensionInstallParams(
20         std::string extension_id,
21         std::string extension_name,
22         gfx::ImageSkia installing_icon,
23         bool is_app,
24         bool is_platform_app);
25 
26     std::string extension_id;
27     std::string extension_name;
28     gfx::ImageSkia installing_icon;
29     bool is_app;
30     bool is_platform_app;
31     bool is_ephemeral;
32   };
33 
34   virtual void OnBeginExtensionInstall(
35       const ExtensionInstallParams& params) = 0;
36 
37   virtual void OnDownloadProgress(const std::string& extension_id,
38                                   int percent_downloaded) = 0;
39 
40   virtual void OnInstallFailure(const std::string& extension_id) = 0;
41 
42   virtual void OnExtensionInstalled(const Extension* extension) = 0;
43   virtual void OnExtensionLoaded(const Extension* extension) = 0;
44   virtual void OnExtensionUnloaded(const Extension* extension) = 0;
45   virtual void OnExtensionUninstalled(const Extension* extension) = 0;
46   virtual void OnAppsReordered() = 0;
47   virtual void OnAppInstalledToAppList(const std::string& extension_id) = 0;
48 
49   // Notifies observers that the observed object is going away.
50   virtual void OnShutdown() = 0;
51 
52  protected:
~InstallObserver()53   virtual ~InstallObserver() {}
54 };
55 
56 }  // namespace extensions
57 
58 #endif  // CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_
59