Temporarily re-enabling SizeAfterPrefChange test with traces (this time for Linux...
[chromium-blink-merge.git] / chrome / browser / extensions / install_observer.h
blob990a62eb36824420330a4f6bf067d609c0484cf1
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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_
6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_
8 #include <string>
10 #include "ui/gfx/image/image_skia.h"
12 namespace extensions {
14 class Extension;
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);
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;
34 // Called at the beginning of the complete installation process, i.e., this
35 // is called before the extension download begins.
36 virtual void OnBeginExtensionInstall(const ExtensionInstallParams& params) {}
38 // Called when the Extension begins the download process. This typically
39 // happens right after OnBeginExtensionInstall(), unless the extension has
40 // already been downloaded.
41 virtual void OnBeginExtensionDownload(const std::string& extension_id) {}
43 // Called whenever the extension download is updated.
44 // Note: Some extensions have multiple modules, so the percent included here
45 // is a simple calculation of:
46 // (finished_files * 100 + current_file_progress) / (total files * 100).
47 virtual void OnDownloadProgress(const std::string& extension_id,
48 int percent_downloaded) {}
50 // Called when the necessary downloads have completed, and the crx
51 // installation is due to start.
52 virtual void OnBeginCrxInstall(const std::string& extension_id) {}
54 // Called when installation of a crx has completed (either successfully or
55 // not).
56 virtual void OnFinishCrxInstall(const std::string& extension_id,
57 bool success) {}
59 // Called if the extension fails to install.
60 virtual void OnInstallFailure(const std::string& extension_id) {}
62 // Called if the installation succeeds.
63 virtual void OnExtensionInstalled(const Extension* extension) {}
65 // Called when an extension is [Loaded, Unloaded, Uninstalled] or an app is
66 // installed to the app list. These are simply forwarded from the
67 // chrome::NOTIFICATIONs.
68 virtual void OnExtensionLoaded(const Extension* extension) {}
69 virtual void OnExtensionUnloaded(const Extension* extension) {}
70 virtual void OnExtensionUninstalled(const Extension* extension) {}
71 virtual void OnDisabledExtensionUpdated(const Extension* extension) {}
72 virtual void OnAppInstalledToAppList(const std::string& extension_id) {}
74 // Called when the app list is reordered.
75 virtual void OnAppsReordered() {}
77 // Notifies observers that the observed object is going away.
78 virtual void OnShutdown() {}
80 protected:
81 virtual ~InstallObserver() {}
84 } // namespace extensions
86 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_