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

Unified Diff: chrome/browser/extensions/crx_installer.cc

Issue 174036: Get rid of the extension's "Current Version" file. (Closed)
Patch Set: merge conflicts Created 11 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
« no previous file with comments | « chrome/browser/extensions/crx_installer.h ('k') | chrome/browser/extensions/extension_file_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/crx_installer.cc
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 352cd8c7198289ed59a48b01dfb4522ed7e7f21f..677aada3b3242fd4a948b331358cc4108e30d6d4 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -171,6 +171,9 @@ void CrxInstaller::ConfirmInstall() {
return;
}
+ current_version_ =
+ frontend_->extension_prefs()->GetVersionString(extension_->id());
+
if (client_.get()) {
AddRef(); // balanced in ContinueInstall() and AbortInstall().
client_->ConfirmInstall(this, extension_.get(), install_icon_.get());
@@ -199,17 +202,10 @@ void CrxInstaller::CompleteInstall() {
DCHECK(MessageLoop::current() == file_loop_);
FilePath version_dir;
- Extension::InstallType install_type = Extension::INSTALL_ERROR;
- std::string error_msg;
- if (!extension_file_util::InstallExtension(unpacked_extension_root_,
- install_directory_,
- extension_->id(),
- extension_->VersionString(),
- &version_dir,
- &install_type, &error_msg)) {
- ReportFailureFromFileThread(error_msg);
- return;
- }
+ Extension::InstallType install_type =
+ extension_file_util::CompareToInstalledVersion(
+ install_directory_, extension_->id(), current_version_,
+ extension_->VersionString(), &version_dir);
if (install_type == Extension::DOWNGRADE) {
ReportFailureFromFileThread("Attempted to downgrade extension.");
@@ -222,6 +218,13 @@ void CrxInstaller::CompleteInstall() {
return;
}
+ std::string error_msg;
+ if (!extension_file_util::InstallExtension(unpacked_extension_root_,
+ version_dir, &error_msg)) {
+ ReportFailureFromFileThread(error_msg);
+ return;
+ }
+
// This is lame, but we must reload the extension because absolute paths
// inside the content scripts are established inside InitFromValue() and we
// just moved the extension.
« no previous file with comments | « chrome/browser/extensions/crx_installer.h ('k') | chrome/browser/extensions/extension_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698