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

Unified Diff: chrome/browser/extensions/webstore_installer.h

Issue 9837054: Improve WebstoreInstaller error handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 33dadf0be71c1e47c017adfa4a7526580c071622..0c0d918e0cc9670eadd529994ba43480840161b1 100644
--- a/chrome/browser/extensions/webstore_installer.h
+++ b/chrome/browser/extensions/webstore_installer.h
@@ -11,19 +11,24 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
+#include "content/public/browser/download_id.h"
+#include "content/public/browser/download_item.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "net/base/net_errors.h"
#include "googleurl/src/gurl.h"
class FilePath;
class Profile;
namespace content {
+class DownloadItem;
Randy Smith (Not in Mondays) 2012/03/23 20:57:19 Why is this forward decl needed if you're includin
jstritar 2012/03/23 21:52:53 Done.
class NavigationController;
}
// Downloads and installs extensions from the web store.
class WebstoreInstaller : public content::NotificationObserver,
+ public content::DownloadItem::Observer,
public base::RefCounted<WebstoreInstaller> {
public:
enum Flag {
@@ -41,7 +46,6 @@ class WebstoreInstaller : public content::NotificationObserver,
const std::string& error) = 0;
};
-
// Creates a WebstoreInstaller for downloading and installing the extension
// with the given |id| from the Chrome Web Store. If |delegate| is not NULL,
// it will be notified when the install succeeds or fails. The installer will
@@ -68,6 +72,13 @@ class WebstoreInstaller : public content::NotificationObserver,
static void SetDownloadDirectoryForTests(FilePath* directory);
private:
+ // DownloadManager::DownloadUrl callback.
+ void OnDownloadStarted(content::DownloadId id, net::Error error);
+
+ // DownloadItem::Observer implementation:
+ virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE;
+ virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE;
+
// Starts downloading the extension to |file_path|.
void StartDownload(const FilePath& file_path);
@@ -85,6 +96,7 @@ class WebstoreInstaller : public content::NotificationObserver,
Delegate* delegate_;
content::NavigationController* controller_;
std::string id_;
+ content::DownloadId download_id_;
int flags_;
GURL download_url_;
};

Powered by Google App Engine
This is Rietveld 408576698