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

Unified Diff: chrome/browser/extensions/updater/extension_updater.cc

Issue 9718028: Allow autoupdate to update disabled extensions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 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
Index: chrome/browser/extensions/updater/extension_updater.cc
diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc
index ff3fdafc80c93acad17f929281b49a6ae4e04399..fa99228f790574f84ef20c35574c248b82b99673 100644
--- a/chrome/browser/extensions/updater/extension_updater.cc
+++ b/chrome/browser/extensions/updater/extension_updater.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_set.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
@@ -262,6 +261,25 @@ void ExtensionUpdater::DoCheckSoon() {
will_check_soon_ = false;
}
+void ExtensionUpdater::AddToDownloader(const ExtensionSet* extensions,
+ const std::set<std::string>& pending_ids) {
+ for (ExtensionSet::const_iterator iter = extensions->begin();
+ iter != extensions->end(); ++iter) {
+ const Extension& extension = **iter;
+ if (!Extension::IsAutoUpdateableLocation(extension.location())) {
+ VLOG(2) << "Extension " << extension.id() << " is not auto updateable";
+ continue;
+ }
+ // An extension might be overwritten by policy, and have its update url
+ // changed. Make sure existing extensions aren't fetched again, if a
+ // pending fetch for an extension with the same id already exists.
+ if (!ContainsKey(pending_ids, extension.id())) {
+ if (downloader_->AddExtension(extension))
+ in_progress_ids_.insert(extension.id());
+ }
+ }
+}
+
void ExtensionUpdater::CheckNow() {
VLOG(2) << "Starting update check";
DCHECK(alive_);
@@ -296,24 +314,8 @@ void ExtensionUpdater::CheckNow() {
in_progress_ids_.insert(*iter);
}
- // Add fetch records for extensions that are installed and have an
- // update URL.
- const ExtensionSet* extensions = service_->extensions();
- for (ExtensionSet::const_iterator iter = extensions->begin();
- iter != extensions->end(); ++iter) {
- const Extension& extension = **iter;
- if (!Extension::IsAutoUpdateableLocation(extension.location())) {
- VLOG(2) << "Extension " << extension.id() << " is not auto updateable";
- continue;
- }
- // An extension might be overwritten by policy, and have its update url
- // changed. Make sure existing extensions aren't fetched again, if a
- // pending fetch for an extension with the same id already exists.
- if (!ContainsKey(pending_ids, extension.id())) {
- if (downloader_->AddExtension(extension))
- in_progress_ids_.insert(extension.id());
- }
- }
+ AddToDownloader(service_->extensions(), pending_ids);
+ AddToDownloader(service_->disabled_extensions(), pending_ids);
// Start a fetch of the blacklist if needed.
if (blacklist_checks_enabled_) {
@@ -417,7 +419,7 @@ bool ExtensionUpdater::GetExtensionExistingVersion(const std::string& id,
*version = prefs_->GetString(kExtensionBlacklistUpdateVersion);
return true;
}
- const Extension* extension = service_->GetExtensionById(id, false);
+ const Extension* extension = service_->GetExtensionById(id, true);
if (!extension)
return false;
*version = extension->version()->GetString();

Powered by Google App Engine
This is Rietveld 408576698