| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 return false; | 314 return false; |
| 315 | 315 |
| 316 base::ScopedTempDir temp_dir; | 316 base::ScopedTempDir temp_dir; |
| 317 if (!temp_dir.CreateUniqueTempDir()) | 317 if (!temp_dir.CreateUniqueTempDir()) |
| 318 return false; | 318 return false; |
| 319 | 319 |
| 320 // Zip up the extension. | 320 // Zip up the extension. |
| 321 base::FilePath zip_path; | 321 base::FilePath zip_path; |
| 322 std::vector<uint8_t> signature; | 322 std::vector<uint8_t> signature; |
| 323 bool result = false; | 323 bool result = false; |
| 324 if (CreateZip(extension_dir, temp_dir.path(), &zip_path) && | 324 if (CreateZip(extension_dir, temp_dir.GetPath(), &zip_path) && |
| 325 SignZip(zip_path, key_pair.get(), &signature) && | 325 SignZip(zip_path, key_pair.get(), &signature) && |
| 326 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { | 326 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { |
| 327 result = true; | 327 result = true; |
| 328 } | 328 } |
| 329 | 329 |
| 330 base::DeleteFile(zip_path, false); | 330 base::DeleteFile(zip_path, false); |
| 331 return result; | 331 return result; |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace extensions | 334 } // namespace extensions |
| OLD | NEW |