Add chrome.webstore API methods to allow sites to see progress of installation
Add two chrome.webstore API methods for progress updates:
chrome.webstore.setInstallStageListener(function(string stage))
- stage is either "downloading" or "installing"
chrome.webstore.setDownloadProgressListener(function(int percent_downloaded))
Update InstallObserver to have methods for install stages.
Make WebstoreInstaller provide more frequent download updates (current consumers
like WebstoreResult imply this was intended from the start).
BUG=308634
Review URL: https://codereview.chromium.org/175263003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259483 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/install_tracker.cc b/chrome/browser/extensions/install_tracker.cc
index 0c79c1c..fc5b5049 100644
--- a/chrome/browser/extensions/install_tracker.cc
+++ b/chrome/browser/extensions/install_tracker.cc
@@ -56,12 +56,22 @@
OnBeginExtensionInstall(params));
}
+void InstallTracker::OnBeginExtensionDownload(const std::string& extension_id) {
+ FOR_EACH_OBSERVER(
+ InstallObserver, observers_, OnBeginExtensionDownload(extension_id));
+}
+
void InstallTracker::OnDownloadProgress(const std::string& extension_id,
int percent_downloaded) {
FOR_EACH_OBSERVER(InstallObserver, observers_,
OnDownloadProgress(extension_id, percent_downloaded));
}
+void InstallTracker::OnBeginCrxInstall(const std::string& extension_id) {
+ FOR_EACH_OBSERVER(
+ InstallObserver, observers_, OnBeginCrxInstall(extension_id));
+}
+
void InstallTracker::OnInstallFailure(
const std::string& extension_id) {
FOR_EACH_OBSERVER(InstallObserver, observers_,