From bcd1eaf7295568d672bd856d6f6e4061bb3a5d2e Mon Sep 17 00:00:00 2001 From: "sail@chromium.org" Date: Wed, 3 Oct 2012 05:42:29 +0000 Subject: Mac Web Intents Part 1: Show extension download progress As per spec we want to show the extension download UI through the Web Intents Picker dialog. This CL also pipes download progress to the WebIntentPickerModel. I'll send out a separate CL to update the Mac UI to show the download progress. I also have a separate CL out for review to hide the download from the browser download shelf: https://codereview.chromium.org/11016022 BUG=152010 TEST=Go to http://webintents.org. Click share. Click "Add to Chrome". Verify that the download shelf is not shown. Review URL: https://chromiumcodereview.appspot.com/10980002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159836 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/webstore_installer.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'chrome/browser/extensions/webstore_installer.h') diff --git a/chrome/browser/extensions/webstore_installer.h b/chrome/browser/extensions/webstore_installer.h index 1555234..2224305 100644 --- a/chrome/browser/extensions/webstore_installer.h +++ b/chrome/browser/extensions/webstore_installer.h @@ -44,11 +44,21 @@ class WebstoreInstaller :public content::NotificationObserver, FLAG_INLINE_INSTALL = 1 << 0 }; + enum FailureReason { + FAILURE_REASON_CANCELLED, + FAILURE_REASON_OTHER + }; + class Delegate { public: + virtual void OnExtensionDownloadStarted(const std::string& id, + content::DownloadItem* item); + virtual void OnExtensionDownloadProgress(const std::string& id, + content::DownloadItem* item); virtual void OnExtensionInstallSuccess(const std::string& id) = 0; virtual void OnExtensionInstallFailure(const std::string& id, - const std::string& error) = 0; + const std::string& error, + FailureReason reason) = 0; protected: virtual ~Delegate() {} @@ -145,7 +155,7 @@ class WebstoreInstaller :public content::NotificationObserver, // 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); + void ReportFailure(const std::string& error, FailureReason reason); // Reports a successful install to the delegate for the given extension if // this managed its installation. This also removes the associated -- cgit v1.1