OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/component_updater/component_updater_utils.h" | 5 #include "chrome/browser/component_updater/component_updater_utils.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" | 35 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" |
36 "<request protocol=\"3.0\" "); | 36 "<request protocol=\"3.0\" "); |
37 | 37 |
38 if (!additional_attributes.empty()) | 38 if (!additional_attributes.empty()) |
39 base::StringAppendF(&request, "%s ", additional_attributes.c_str()); | 39 base::StringAppendF(&request, "%s ", additional_attributes.c_str()); |
40 | 40 |
41 // Chrome version and platform information. | 41 // Chrome version and platform information. |
42 base::StringAppendF( | 42 base::StringAppendF( |
43 &request, | 43 &request, |
44 "version=\"%s-%s\" prodversion=\"%s\" " | 44 "version=\"%s-%s\" prodversion=\"%s\" " |
45 "requestid=\"{%s}\" updaterchannel=\"%s\" arch=\"%s\" nacl_arch=\"%s\"", | 45 "requestid=\"{%s}\" updaterchannel=\"%s\" " |
| 46 "os=\"%s\" arch=\"%s\" nacl_arch=\"%s\"", |
46 prod_id.c_str(), chrome_version.c_str(), // "version" | 47 prod_id.c_str(), chrome_version.c_str(), // "version" |
47 chrome_version.c_str(), // "prodversion" | 48 chrome_version.c_str(), // "prodversion" |
48 base::GenerateGUID().c_str(), // "requestid" | 49 base::GenerateGUID().c_str(), // "requestid" |
49 chrome::OmahaQueryParams::GetChannelString(), // "updaterchannel" | 50 chrome::OmahaQueryParams::GetChannelString(), // "updaterchannel" |
| 51 chrome::OmahaQueryParams::getOS(), // "os" |
50 chrome::OmahaQueryParams::getArch(), // "arch" | 52 chrome::OmahaQueryParams::getArch(), // "arch" |
51 chrome::OmahaQueryParams::getNaclArch()); // "nacl_arch" | 53 chrome::OmahaQueryParams::getNaclArch()); // "nacl_arch" |
52 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
53 const bool is_wow64( | 55 const bool is_wow64( |
54 base::win::OSInfo::GetInstance()->wow64_status() == | 56 base::win::OSInfo::GetInstance()->wow64_status() == |
55 base::win::OSInfo::WOW64_ENABLED); | 57 base::win::OSInfo::WOW64_ENABLED); |
56 if (is_wow64) | 58 if (is_wow64) |
57 base::StringAppendF(&request, " wow64=\"1\""); | 59 base::StringAppendF(&request, " wow64=\"1\""); |
58 #endif | 60 #endif |
59 base::StringAppendF(&request, ">"); | 61 base::StringAppendF(&request, ">"); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 165 } |
164 | 166 |
165 std::string GetCrxComponentID(const CrxComponent& component) { | 167 std::string GetCrxComponentID(const CrxComponent& component) { |
166 return component_updater::HexStringToID( | 168 return component_updater::HexStringToID( |
167 StringToLowerASCII(base::HexEncode(&component.pk_hash[0], | 169 StringToLowerASCII(base::HexEncode(&component.pk_hash[0], |
168 component.pk_hash.size()/2))); | 170 component.pk_hash.size()/2))); |
169 } | 171 } |
170 | 172 |
171 } // namespace component_updater | 173 } // namespace component_updater |
172 | 174 |
OLD | NEW |