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

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: Latest master 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 15 matching lines...) Expand all
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 // Called at the beginning of the complete installation process, i.e., this 34 // Called at the beginning of the complete installation process, i.e., this
35 // is called before the extension download begins. 35 // is called before the extension download begins.
36 virtual void OnBeginExtensionInstall(const ExtensionInstallParams& params); 36 virtual void OnBeginExtensionInstall(const ExtensionInstallParams& params) {}
37
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) {}
37 42
38 // Called whenever the extension download is updated. 43 // Called whenever the extension download is updated.
39 // Note: Some extensions have multiple modules, so the percent included here 44 // Note: Some extensions have multiple modules, so the percent included here
40 // is a simple calculation of: 45 // is a simple calculation of:
41 // (finished_files * 100 + current_file_progress) / (total files * 100). 46 // (finished_files * 100 + current_file_progress) / (total files * 100).
42 virtual void OnDownloadProgress(const std::string& extension_id, 47 virtual void OnDownloadProgress(const std::string& extension_id,
43 int percent_downloaded); 48 int percent_downloaded) {}
49
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) {}
44 53
45 // Called if the extension fails to install. 54 // Called if the extension fails to install.
46 virtual void OnInstallFailure(const std::string& extension_id); 55 virtual void OnInstallFailure(const std::string& extension_id) {}
47 56
48 // Called if the installation succeeds. 57 // Called if the installation succeeds.
49 virtual void OnExtensionInstalled(const Extension* extension); 58 virtual void OnExtensionInstalled(const Extension* extension) {}
50 59
51 // Called when an extension is [Loaded, Unloaded, Uninstalled] or an app is 60 // Called when an extension is [Loaded, Unloaded, Uninstalled] or an app is
52 // installed to the app list. These are simply forwarded from the 61 // installed to the app list. These are simply forwarded from the
53 // chrome::NOTIFICATIONs. 62 // chrome::NOTIFICATIONs.
54 virtual void OnExtensionLoaded(const Extension* extension); 63 virtual void OnExtensionLoaded(const Extension* extension) {}
55 virtual void OnExtensionUnloaded(const Extension* extension); 64 virtual void OnExtensionUnloaded(const Extension* extension) {}
56 virtual void OnExtensionUninstalled(const Extension* extension); 65 virtual void OnExtensionUninstalled(const Extension* extension) {}
57 virtual void OnDisabledExtensionUpdated(const Extension* extension); 66 virtual void OnDisabledExtensionUpdated(const Extension* extension) {}
58 virtual void OnAppInstalledToAppList(const std::string& extension_id); 67 virtual void OnAppInstalledToAppList(const std::string& extension_id) {}
59 68
60 // Called when the app list is reordered. 69 // Called when the app list is reordered.
61 virtual void OnAppsReordered(); 70 virtual void OnAppsReordered() {}
62 71
63 // Notifies observers that the observed object is going away. 72 // Notifies observers that the observed object is going away.
64 virtual void OnShutdown(); 73 virtual void OnShutdown() {}
65 74
66 protected: 75 protected:
67 virtual ~InstallObserver() {} 76 virtual ~InstallObserver() {}
68 }; 77 };
69 78
70 } // namespace extensions 79 } // namespace extensions
71 80
72 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ 81 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/crx_installer.cc ('k') | chrome/browser/extensions/install_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698