| Index: extensions/browser/updater/update_service.h
|
| diff --git a/extensions/browser/updater/update_service.h b/extensions/browser/updater/update_service.h
|
| index 4d19204e1e32cd6f046384462eeed92c4d970b99..0ee321c80456fcd83b411765350d45d0cd359daa 100644
|
| --- a/extensions/browser/updater/update_service.h
|
| +++ b/extensions/browser/updater/update_service.h
|
| @@ -6,62 +6,53 @@
|
| #define EXTENSIONS_BROWSER_UPDATER_UPDATE_SERVICE_H_
|
|
|
| #include <string>
|
| +#include <vector>
|
|
|
| #include "base/callback.h"
|
| #include "base/macros.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "components/keyed_service/core/keyed_service.h"
|
| -#include "extensions/browser/updater/extension_downloader_delegate.h"
|
|
|
| namespace content {
|
| class BrowserContext;
|
| }
|
|
|
| +namespace update_client {
|
| +class UpdateClient;
|
| +}
|
| +
|
| namespace extensions {
|
|
|
| -class ExtensionDownloader;
|
| +class UpdateDataProvider;
|
| +class UpdateService;
|
| class UpdateServiceFactory;
|
| -class UpdateServiceTest;
|
|
|
| -// This service manages the download, update, and installation of extensions.
|
| -// It is currently only used by app_shell, but should eventually replace
|
| -// ExtensionUpdater in Chrome.
|
| +// This service manages the autoupdate of extensions. It should eventually
|
| +// replace ExtensionUpdater in Chrome.
|
| // TODO(rockot): Replace ExtensionUpdater with this service.
|
| -class UpdateService : public KeyedService, public ExtensionDownloaderDelegate {
|
| +class UpdateService : public KeyedService {
|
| public:
|
| static UpdateService* Get(content::BrowserContext* context);
|
|
|
| - // TODO(rockot): Remove this. It's a placeholder for a real service interface.
|
| - // Downloads and (TODO) installs a CRX within the current browser context.
|
| - void DownloadAndInstall(const std::string& id,
|
| - const base::Callback<void(bool)>& callback);
|
| + void Shutdown() override;
|
| +
|
| + // Starts an update check for each of |extension_ids|. If there are any
|
| + // updates available, they will be downloaded, checked for integrity,
|
| + // unpacked, and then passed off to the ExtensionSystem::InstallUpdate method
|
| + // for install completion.
|
| + void StartUpdateCheck(std::vector<std::string> extension_ids);
|
|
|
| private:
|
| friend class UpdateServiceFactory;
|
| - friend class UpdateServiceTest;
|
|
|
| - explicit UpdateService(content::BrowserContext* context);
|
| + UpdateService(content::BrowserContext* context,
|
| + scoped_refptr<update_client::UpdateClient> update_client);
|
| ~UpdateService() override;
|
|
|
| - // ExtensionDownloaderDelegate:
|
| - void OnExtensionDownloadFailed(const std::string& id,
|
| - Error error,
|
| - const PingResult& ping,
|
| - const std::set<int>& request_ids) override;
|
| - void OnExtensionDownloadFinished(const CRXFileInfo& file,
|
| - bool file_ownership_passed,
|
| - const GURL& download_url,
|
| - const std::string& version,
|
| - const PingResult& ping,
|
| - const std::set<int>& request_id,
|
| - const InstallCallback& callback) override;
|
| - bool IsExtensionPending(const std::string& id) override;
|
| - bool GetExtensionExistingVersion(const std::string& id,
|
| - std::string* version) override;
|
| -
|
| - content::BrowserContext* browser_context_;
|
| - scoped_ptr<ExtensionDownloader> downloader_;
|
| - base::Callback<void(bool)> download_callback_;
|
| + content::BrowserContext* context_;
|
| +
|
| + scoped_refptr<update_client::UpdateClient> update_client_;
|
| + scoped_refptr<UpdateDataProvider> update_data_provider_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(UpdateService);
|
| };
|
|
|