OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_creator.h" | 5 #include "chrome/browser/extensions/extension_creator.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 173 } |
174 std::string pem_output; | 174 std::string pem_output; |
175 if (!Extension::FormatPEMForFileOutput(private_key, &pem_output, | 175 if (!Extension::FormatPEMForFileOutput(private_key, &pem_output, |
176 false)) { | 176 false)) { |
177 error_message_ = | 177 error_message_ = |
178 l10n_util::GetStringUTF8(IDS_EXTENSION_PRIVATE_KEY_FAILED_TO_OUTPUT); | 178 l10n_util::GetStringUTF8(IDS_EXTENSION_PRIVATE_KEY_FAILED_TO_OUTPUT); |
179 return NULL; | 179 return NULL; |
180 } | 180 } |
181 | 181 |
182 if (!output_private_key_path.empty()) { | 182 if (!output_private_key_path.empty()) { |
183 if (-1 == file_util::WriteFile(output_private_key_path, | 183 if (-1 == base::WriteFile(output_private_key_path, |
184 pem_output.c_str(), pem_output.size())) { | 184 pem_output.c_str(), pem_output.size())) { |
185 error_message_ = | 185 error_message_ = |
186 l10n_util::GetStringUTF8(IDS_EXTENSION_PRIVATE_KEY_FAILED_TO_OUTPUT); | 186 l10n_util::GetStringUTF8(IDS_EXTENSION_PRIVATE_KEY_FAILED_TO_OUTPUT); |
187 return NULL; | 187 return NULL; |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 return key_pair.release(); | 191 return key_pair.release(); |
192 } | 192 } |
193 | 193 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 SignZip(zip_path, key_pair.get(), &signature) && | 323 SignZip(zip_path, key_pair.get(), &signature) && |
324 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { | 324 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { |
325 result = true; | 325 result = true; |
326 } | 326 } |
327 | 327 |
328 base::DeleteFile(zip_path, false); | 328 base::DeleteFile(zip_path, false); |
329 return result; | 329 return result; |
330 } | 330 } |
331 | 331 |
332 } // namespace extensions | 332 } // namespace extensions |
OLD | NEW |