Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/update_client/update_checker.h" | 5 #include "components/update_client/update_checker.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 const CrxUpdateItem* item = items[i]; | 79 const CrxUpdateItem* item = items[i]; |
| 80 const update_client::InstallerAttributes installer_attributes( | 80 const update_client::InstallerAttributes installer_attributes( |
| 81 SanitizeInstallerAttributes(item->component.installer_attributes)); | 81 SanitizeInstallerAttributes(item->component.installer_attributes)); |
| 82 std::string app("<app "); | 82 std::string app("<app "); |
| 83 base::StringAppendF(&app, "appid=\"%s\" version=\"%s\"", item->id.c_str(), | 83 base::StringAppendF(&app, "appid=\"%s\" version=\"%s\"", item->id.c_str(), |
| 84 item->component.version.GetString().c_str()); | 84 item->component.version.GetString().c_str()); |
| 85 if (!brand.empty()) | 85 if (!brand.empty()) |
| 86 base::StringAppendF(&app, " brand=\"%s\"", brand.c_str()); | 86 base::StringAppendF(&app, " brand=\"%s\"", brand.c_str()); |
| 87 if (item->on_demand) | 87 if (item->on_demand) |
| 88 base::StringAppendF(&app, " installsource=\"ondemand\""); | 88 base::StringAppendF(&app, " installsource=\"ondemand\""); |
| 89 | 89 for (const auto& attr : installer_attributes) { |
| 90 for (const auto& attr : installer_attributes) | |
| 91 base::StringAppendF(&app, " %s=\"%s\"", attr.first.c_str(), | 90 base::StringAppendF(&app, " %s=\"%s\"", attr.first.c_str(), |
| 92 attr.second.c_str()); | 91 attr.second.c_str()); |
| 92 } | |
| 93 base::StringAppendF(&app, ">"); | |
| 93 | 94 |
| 94 base::StringAppendF(&app, ">"); | 95 base::StringAppendF(&app, "<updatecheck"); |
| 95 base::StringAppendF(&app, "<updatecheck />"); | 96 if (item->component.supports_group_policy_enable_component_updates && |
| 97 !config.EnabledComponentUpdates()) { | |
| 98 base::StringAppendF(&app, " \"updatedisabled\"=true"); | |
|
waffles
2016/08/03 23:49:02
I think you mean " updatedisabled=\"true\"". (Also
| |
| 99 } | |
| 100 base::StringAppendF(&app, "/>"); | |
| 101 | |
| 96 base::StringAppendF(&app, "<ping rd=\"%d\" ping_freshness=\"%s\" />", | 102 base::StringAppendF(&app, "<ping rd=\"%d\" ping_freshness=\"%s\" />", |
| 97 metadata->GetDateLastRollCall(item->id), | 103 metadata->GetDateLastRollCall(item->id), |
| 98 metadata->GetPingFreshness(item->id).c_str()); | 104 metadata->GetPingFreshness(item->id).c_str()); |
| 99 if (!item->component.fingerprint.empty()) { | 105 if (!item->component.fingerprint.empty()) { |
| 100 base::StringAppendF(&app, | 106 base::StringAppendF(&app, |
| 101 "<packages>" | 107 "<packages>" |
| 102 "<package fp=\"%s\"/>" | 108 "<package fp=\"%s\"/>" |
| 103 "</packages>", | 109 "</packages>", |
| 104 item->component.fingerprint.c_str()); | 110 item->component.fingerprint.c_str()); |
| 105 } | 111 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 } // namespace | 218 } // namespace |
| 213 | 219 |
| 214 std::unique_ptr<UpdateChecker> UpdateChecker::Create( | 220 std::unique_ptr<UpdateChecker> UpdateChecker::Create( |
| 215 const scoped_refptr<Configurator>& config, | 221 const scoped_refptr<Configurator>& config, |
| 216 PersistedData* persistent) { | 222 PersistedData* persistent) { |
| 217 return std::unique_ptr<UpdateChecker>( | 223 return std::unique_ptr<UpdateChecker>( |
| 218 new UpdateCheckerImpl(config, persistent)); | 224 new UpdateCheckerImpl(config, persistent)); |
| 219 } | 225 } |
| 220 | 226 |
| 221 } // namespace update_client | 227 } // namespace update_client |
| OLD | NEW |