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

Unified Diff: chrome/browser/extensions/updater/extension_downloader.h

Issue 456063002: ExtensionUpdater: Abstract ExtensionDownloader creation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments and some cleanup Created 6 years, 4 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/updater/extension_downloader.h
diff --git a/chrome/browser/extensions/updater/extension_downloader.h b/chrome/browser/extensions/updater/extension_downloader.h
index d8704ffc00714d45af0194fe44110da227d81028..a0409866f17938dfcfb8bd9594de7fe2cfbce0b9 100644
--- a/chrome/browser/extensions/updater/extension_downloader.h
+++ b/chrome/browser/extensions/updater/extension_downloader.h
@@ -47,7 +47,6 @@ struct UpdateDetails {
class ExtensionCache;
class ExtensionUpdaterTest;
-class WebstoreOAuth2TokenProvider;
// A class that checks for updates of a given list of extensions, and downloads
// the crx file when updates are found. It uses a |ExtensionDownloaderDelegate|
@@ -57,13 +56,16 @@ class ExtensionDownloader
: public net::URLFetcherDelegate,
public OAuth2TokenService::Consumer {
public:
+ // A closure which constructs a new ExtensionDownloader to be owned by the
+ // caller.
+ typedef base::Callback<
+ scoped_ptr<ExtensionDownloader>(ExtensionDownloaderDelegate* delegate)>
+ Factory;
+
// |delegate| is stored as a raw pointer and must outlive the
- // ExtensionDownloader. |webstore_identity_provider| may be NULL if this
- // ExtensionDownloader does not need OAuth2 support; if not NULL, the
- // given IdentityProvider must outlive this ExtensionDownloader.
+ // ExtensionDownloader.
ExtensionDownloader(ExtensionDownloaderDelegate* delegate,
- net::URLRequestContextGetter* request_context,
- IdentityProvider* webstore_identity_provider);
+ net::URLRequestContextGetter* request_context);
virtual ~ExtensionDownloader();
// Adds |extension| to the list of extensions to check for updates.
@@ -93,6 +95,11 @@ class ExtensionDownloader
const ManifestFetchData::PingData& ping_data,
int request_id);
+ // Sets an IdentityProvider to be used for OAuth2 authentication on protected
+ // Webstore downloads.
+ void SetWebstoreIdentityProvider(
+ scoped_ptr<IdentityProvider> identity_provider);
+
// These are needed for unit testing, to help identify the correct mock
// URLFetcher objects.
static const int kManifestFetcherId = 1;
@@ -275,7 +282,7 @@ class ExtensionDownloader
// An IdentityProvider which may be used for authentication on protected
// download requests. May be NULL.
- IdentityProvider* identity_provider_;
+ scoped_ptr<IdentityProvider> identity_provider_;
// A Webstore download-scoped access token for the |identity_provider_|'s
// active account, if any.
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/updater/extension_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698