summaryrefslogtreecommitdiffstats
path: root/extensions/shell
diff options
context:
space:
mode:
authorasargent <asargent@chromium.org>2015-10-15 14:51:48 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-15 21:52:40 +0000
commit631a99a61cbe3e7e03e372b3d37c6a37fa700392 (patch)
tree95c4fc66df8e20ba8744159f0ae63913e1750a4a /extensions/shell
parenta33cc7d19a2c878e2a7d9b4a540d06f3e0c3fc16 (diff)
downloadchromium_src-631a99a61cbe3e7e03e372b3d37c6a37fa700392.zip
chromium_src-631a99a61cbe3e7e03e372b3d37c6a37fa700392.tar.gz
chromium_src-631a99a61cbe3e7e03e372b3d37c6a37fa700392.tar.bz2
Add extensions code to use common updater in components/update_client/
This is another piece of work towards implementing differential extensions update and share autoupdate code with the chrome components system. It adds code to the extensions/browser directory that makes use of the common autoupdate code via the update_client::UpdateClient class to send update checks to the server, download a full .crx or differential update, and hand back an unpacked directory with the contents of the new extension version. This CL does not yet add any code in chrome/ that actually uses these new capabilities; that will be in a forthcoming CL. BUG=490418 Review URL: https://codereview.chromium.org/1362043005 Cr-Commit-Position: refs/heads/master@{#354370}
Diffstat (limited to 'extensions/shell')
-rw-r--r--extensions/shell/browser/shell_browser_main_parts.cc18
-rw-r--r--extensions/shell/browser/shell_extension_system.cc6
-rw-r--r--extensions/shell/browser/shell_extension_system.h2
-rw-r--r--extensions/shell/common/switches.cc3
-rw-r--r--extensions/shell/common/switches.h1
5 files changed, 8 insertions, 22 deletions
diff --git a/extensions/shell/browser/shell_browser_main_parts.cc b/extensions/shell/browser/shell_browser_main_parts.cc
index 073dacb..0153679 100644
--- a/extensions/shell/browser/shell_browser_main_parts.cc
+++ b/extensions/shell/browser/shell_browser_main_parts.cc
@@ -73,13 +73,6 @@ using content::BrowserThread;
namespace extensions {
-namespace {
-
-void CrxInstallComplete(bool success) {
- VLOG(1) << "CRX download complete. Success: " << success;
-}
-}
-
ShellBrowserMainParts::ShellBrowserMainParts(
const content::MainFunctionParams& parameters,
ShellBrowserMainDelegate* browser_main_delegate)
@@ -211,17 +204,6 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
base::Bind(nacl::NaClProcessHost::EarlyStartup));
#endif
- // TODO(rockot): Remove this temporary hack test.
- std::string install_crx_id =
- cmd->GetSwitchValueASCII(switches::kAppShellInstallCrx);
- if (install_crx_id.size() != 0) {
- CHECK(install_crx_id.size() == 32)
- << "Extension ID must be exactly 32 characters long.";
- UpdateService* update_service = UpdateService::Get(browser_context_.get());
- update_service->DownloadAndInstall(install_crx_id,
- base::Bind(CrxInstallComplete));
- }
-
devtools_http_handler_.reset(
content::ShellDevToolsManagerDelegate::CreateHttpHandler(
browser_context_.get()));
diff --git a/extensions/shell/browser/shell_extension_system.cc b/extensions/shell/browser/shell_extension_system.cc
index 0457491..b6cff6a 100644
--- a/extensions/shell/browser/shell_extension_system.cc
+++ b/extensions/shell/browser/shell_extension_system.cc
@@ -176,6 +176,12 @@ scoped_ptr<ExtensionSet> ShellExtensionSystem::GetDependentExtensions(
return make_scoped_ptr(new ExtensionSet());
}
+void ShellExtensionSystem::InstallUpdate(const std::string& extension_id,
+ const base::FilePath& temp_dir) {
+ NOTREACHED();
+ base::DeleteFile(temp_dir, true /* recursive */);
+}
+
void ShellExtensionSystem::OnExtensionRegisteredWithRequestContexts(
scoped_refptr<Extension> extension) {
ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context_);
diff --git a/extensions/shell/browser/shell_extension_system.h b/extensions/shell/browser/shell_extension_system.h
index f042f2d..ca2cb5e 100644
--- a/extensions/shell/browser/shell_extension_system.h
+++ b/extensions/shell/browser/shell_extension_system.h
@@ -64,6 +64,8 @@ class ShellExtensionSystem : public ExtensionSystem {
ContentVerifier* content_verifier() override;
scoped_ptr<ExtensionSet> GetDependentExtensions(
const Extension* extension) override;
+ void InstallUpdate(const std::string& extension_id,
+ const base::FilePath& temp_dir) override;
private:
void OnExtensionRegisteredWithRequestContexts(
diff --git a/extensions/shell/common/switches.cc b/extensions/shell/common/switches.cc
index fbb5783..66bd7e5 100644
--- a/extensions/shell/common/switches.cc
+++ b/extensions/shell/common/switches.cc
@@ -13,9 +13,6 @@ const char kAppShellAllowRoaming[] = "app-shell-allow-roaming";
// Size for the host window to create (i.e. "800x600").
const char kAppShellHostWindowSize[] = "app-shell-host-window-size";
-// ID of an extension CRX to be downloaded from the web store.
-const char kAppShellInstallCrx[] = "app-shell-install-crx";
-
// SSID of the preferred WiFi network.
const char kAppShellPreferredNetwork[] = "app-shell-preferred-network";
diff --git a/extensions/shell/common/switches.h b/extensions/shell/common/switches.h
index b6b3932..7cfe1d6 100644
--- a/extensions/shell/common/switches.h
+++ b/extensions/shell/common/switches.h
@@ -12,7 +12,6 @@ namespace switches {
// alongside the definition of their values in the .cc file.
extern const char kAppShellAllowRoaming[];
extern const char kAppShellHostWindowSize[];
-extern const char kAppShellInstallCrx[];
extern const char kAppShellPreferredNetwork[];
extern const char kAppShellRefreshToken[];
extern const char kAppShellUser[];