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

Unified Diff: extensions/browser/updater/update_service.h

Issue 1362043005: Add extensions code to use common updater in components/update_client/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merged latest origin/master Created 5 years, 2 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
« no previous file with comments | « extensions/browser/updater/update_install_shim.cc ('k') | extensions/browser/updater/update_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « extensions/browser/updater/update_install_shim.cc ('k') | extensions/browser/updater/update_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698