Chromium Code Reviews| Index: chrome/browser/extensions/updater/manifest_fetch_data.cc |
| diff --git a/chrome/browser/extensions/updater/manifest_fetch_data.cc b/chrome/browser/extensions/updater/manifest_fetch_data.cc |
| index 8ed4fe041fba2b78d0e878857fd2982bbc864d1b..9b417e16f1fc8c0a6e01cbe5542d5a5a916703df 100644 |
| --- a/chrome/browser/extensions/updater/manifest_fetch_data.cc |
| +++ b/chrome/browser/extensions/updater/manifest_fetch_data.cc |
| @@ -67,16 +67,25 @@ bool ManifestFetchData::AddExtension(const std::string& id, |
| const std::string& version, |
| const PingData* ping_data, |
| const std::string& update_url_data, |
| - const std::string& install_source) { |
| + const std::string& install_source, |
| + bool force_update) { |
| if (extension_ids_.find(id) != extension_ids_.end()) { |
| NOTREACHED() << "Duplicate extension id " << id; |
| return false; |
| } |
| + if (force_update) { |
|
Yoyo Zhou
2014/09/02 19:30:04
nit: no braces
Ken Rockot(use gerrit already)
2014/09/02 20:04:30
Done.
|
| + forced_updates_.insert(id); |
| + } |
| + |
| + // If we want to force an update, we send 0.0.0.0 as the installed version |
| + // number. |
| + std::string installed_version = force_update ? "0.0.0.0" : version; |
|
Sorin Jianu
2014/09/02 20:06:39
could be made const.
Ken Rockot(use gerrit already)
2014/09/02 20:19:20
Done.
|
| + |
| // Compute the string we'd append onto the full_url_, and see if it fits. |
| std::vector<std::string> parts; |
| parts.push_back("id=" + id); |
| - parts.push_back("v=" + version); |
| + parts.push_back("v=" + installed_version); |
| if (!install_source.empty()) |
| parts.push_back("installsource=" + install_source); |
| parts.push_back("uc"); |
| @@ -163,4 +172,8 @@ void ManifestFetchData::Merge(const ManifestFetchData& other) { |
| request_ids_.insert(other.request_ids_.begin(), other.request_ids_.end()); |
| } |
| +bool ManifestFetchData::DidForceUpdate(const std::string& extension_id) const { |
| + return forced_updates_.find(extension_id) != forced_updates_.end(); |
| +} |
| + |
| } // namespace extensions |