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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 id.append(1, val + 'a'); | 159 id.append(1, val + 'a'); |
160 } else { | 160 } else { |
161 id.append(1, 'a'); | 161 id.append(1, 'a'); |
162 } | 162 } |
163 } | 163 } |
164 DCHECK(extensions::Extension::IdIsValid(id)); | 164 DCHECK(extensions::Extension::IdIsValid(id)); |
165 return id; | 165 return id; |
166 } | 166 } |
167 | 167 |
168 std::string GetCrxComponentID(const CrxComponent& component) { | 168 std::string GetCrxComponentID(const CrxComponent& component) { |
169 return component_updater::HexStringToID( | 169 return HexStringToID(StringToLowerASCII(base::HexEncode(&component.pk_hash[0], |
170 StringToLowerASCII(base::HexEncode(&component.pk_hash[0], | 170 component.pk_hash.size()/2))); |
171 component.pk_hash.size()/2))); | |
172 } | 171 } |
173 | 172 |
174 } // namespace component_updater | 173 } // namespace component_updater |
175 | 174 |
OLD | NEW |