1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_UPDATER_CHROME_EXTENSION_DOWNLOADER_FACTORY_H_
6 #define CHROME_BROWSER_EXTENSIONS_UPDATER_CHROME_EXTENSION_DOWNLOADER_FACTORY_H_
8 #include "base/memory/scoped_ptr.h"
12 namespace extensions
{
13 class ExtensionDownloader
;
14 class ExtensionDownloaderDelegate
;
18 class URLRequestContextGetter
;
21 // This provides a simple static interface for constructing an
22 // ExtensionDownloader suitable for use from within Chrome.
23 class ChromeExtensionDownloaderFactory
{
25 // Creates a downloader with the given request context. No profile identity
26 // is associated with this downloader.
27 static scoped_ptr
<extensions::ExtensionDownloader
> CreateForRequestContext(
28 net::URLRequestContextGetter
* request_context
,
29 extensions::ExtensionDownloaderDelegate
* delegate
);
31 // Creates a downloader for a given Profile. This downloader will be able
32 // to authenticate as the signed-in user in the event that it's asked to
33 // fetch a protected download.
34 static scoped_ptr
<extensions::ExtensionDownloader
> CreateForProfile(
36 extensions::ExtensionDownloaderDelegate
* delegate
);
39 #endif // CHROME_BROWSER_EXTENSIONS_UPDATER_CHROME_EXTENSION_DOWNLOADER_FACTORY_H_