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

Unified Diff: chrome/browser/extensions/webstore_installer.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/webstore_installer.h
diff --git a/chrome/browser/extensions/webstore_installer.h b/chrome/browser/extensions/webstore_installer.h
index a8b6ce43edbe9cca24fc20e5ccc6c15e65694580..25b2181d681cbf8b6d5c3d42c0d58859f51bd308 100644
--- a/chrome/browser/extensions/webstore_installer.h
+++ b/chrome/browser/extensions/webstore_installer.h
@@ -12,6 +12,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/supports_user_data.h"
+#include "base/timer/timer.h"
#include "base/values.h"
#include "base/version.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
@@ -224,6 +225,9 @@ class WebstoreInstaller : public content::NotificationObserver,
// Starts downloading the extension to |file_path|.
void StartDownload(const base::FilePath& file_path);
+ // Updates the InstallTracker with the latest download progress.
+ void UpdateDownloadProgress();
+
// Reports an install |error| to the delegate for the given extension if this
// managed its installation. This also removes the associated PendingInstall.
void ReportFailure(const std::string& error, FailureReason reason);
@@ -244,6 +248,10 @@ class WebstoreInstaller : public content::NotificationObserver,
// The DownloadItem is owned by the DownloadManager and is valid from when
// OnDownloadStarted is called (with no error) until OnDownloadDestroyed().
content::DownloadItem* download_item_;
+ // Used to periodically update the extension's download status. This will
+ // trigger at least every second, though sometimes more frequently (depending
+ // on number of modules, etc).
+ base::OneShotTimer<WebstoreInstaller> download_progress_timer_;
scoped_ptr<Approval> approval_;
GURL download_url_;
« no previous file with comments | « chrome/browser/extensions/webstore_inline_installer_browsertest.cc ('k') | chrome/browser/extensions/webstore_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698