Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chrome/browser/extensions/install_observer.h

Issue 175263003: Add chrome.webstore API methods to allow sites to see progress of installation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_
6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ui/gfx/image/image_skia.h" 10 #include "ui/gfx/image/image_skia.h"
(...skipping 13 matching lines...) Expand all
24 bool is_platform_app); 24 bool is_platform_app);
25 25
26 std::string extension_id; 26 std::string extension_id;
27 std::string extension_name; 27 std::string extension_name;
28 gfx::ImageSkia installing_icon; 28 gfx::ImageSkia installing_icon;
29 bool is_app; 29 bool is_app;
30 bool is_platform_app; 30 bool is_platform_app;
31 bool is_ephemeral; 31 bool is_ephemeral;
32 }; 32 };
33 33
34 virtual void OnBeginExtensionInstall( 34 // Called at the beginning of the complete installation process, i.e., this
35 const ExtensionInstallParams& params) = 0; 35 // is called before the extension download begins.
36 virtual void OnBeginExtensionInstall(const ExtensionInstallParams& params);
36 37
38 // Called when the Extension begins the download process.
39 // This is typically, but not always, almost immediately after
40 // OnBeginExtensionInstall(). In some cases, though, the extension may already
41 // be downloaded, so we don't want to group the two together incorrectly.
42 virtual void OnBeginExtensionDownload(const std::string& extension_id);
43
44 // Called whenever the extension download is updated.
45 // Note: Some extensions have multiple modules, so the percent included here
46 // is a simple calculation of:
47 // (finished_files * 100 + current_file_progress) / (total files * 100).
37 virtual void OnDownloadProgress(const std::string& extension_id, 48 virtual void OnDownloadProgress(const std::string& extension_id,
38 int percent_downloaded) = 0; 49 int percent_downloaded);
39 50
40 virtual void OnInstallFailure(const std::string& extension_id) = 0; 51 // Called when the necessary downloads have completed, and the crx
52 // installation is due to start.
53 virtual void OnBeginCrxInstall(const std::string& extension_id);
41 54
42 virtual void OnExtensionInstalled(const Extension* extension) = 0; 55 // Called if the extension fails to install.
43 virtual void OnExtensionLoaded(const Extension* extension) = 0; 56 virtual void OnInstallFailure(const std::string& extension_id);
44 virtual void OnExtensionUnloaded(const Extension* extension) = 0; 57
45 virtual void OnExtensionUninstalled(const Extension* extension) = 0; 58 // Called if the installation succeeds.
46 virtual void OnAppsReordered() = 0; 59 virtual void OnExtensionInstalled(const Extension* extension);
47 virtual void OnAppInstalledToAppList(const std::string& extension_id) = 0; 60
61 // Called when an extension is [Loaded, Unloaded, Uninstalled] or an app is
62 // installed to the app list. These are simply forwarded from the
63 // chrome::NOTIFICATIONs.
64 virtual void OnExtensionLoaded(const Extension* extension);
65 virtual void OnExtensionUnloaded(const Extension* extension);
66 virtual void OnExtensionUninstalled(const Extension* extension);
67 virtual void OnAppInstalledToAppList(const std::string& extension_id);
68
69 // Called when the app list is reordered.
70 virtual void OnAppsReordered();
48 71
49 // Notifies observers that the observed object is going away. 72 // Notifies observers that the observed object is going away.
50 virtual void OnShutdown() = 0; 73 virtual void OnShutdown();
51 74
52 protected: 75 protected:
53 virtual ~InstallObserver() {} 76 virtual ~InstallObserver() {}
54 }; 77 };
55 78
56 } // namespace extensions 79 } // namespace extensions
57 80
58 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ 81 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698