| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // useful validation of the structure. | 105 // useful validation of the structure. |
| 106 int create_flags = | 106 int create_flags = |
| 107 Extension::FOLLOW_SYMLINKS_ANYWHERE | Extension::ERROR_ON_PRIVATE_KEY; | 107 Extension::FOLLOW_SYMLINKS_ANYWHERE | Extension::ERROR_ON_PRIVATE_KEY; |
| 108 if (run_flags & kRequireModernManifestVersion) | 108 if (run_flags & kRequireModernManifestVersion) |
| 109 create_flags |= Extension::REQUIRE_MODERN_MANIFEST_VERSION; | 109 create_flags |= Extension::REQUIRE_MODERN_MANIFEST_VERSION; |
| 110 | 110 |
| 111 scoped_refptr<Extension> extension( | 111 scoped_refptr<Extension> extension( |
| 112 extension_file_util::LoadExtension( | 112 extension_file_util::LoadExtension( |
| 113 extension_dir, | 113 extension_dir, |
| 114 extension_id, | 114 extension_id, |
| 115 Extension::INTERNAL, | 115 Manifest::INTERNAL, |
| 116 create_flags, | 116 create_flags, |
| 117 &error_message_)); | 117 &error_message_)); |
| 118 return !!extension.get(); | 118 return !!extension.get(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 crypto::RSAPrivateKey* ExtensionCreator::ReadInputKey(const FilePath& | 121 crypto::RSAPrivateKey* ExtensionCreator::ReadInputKey(const FilePath& |
| 122 private_key_path) { | 122 private_key_path) { |
| 123 if (!file_util::PathExists(private_key_path)) { | 123 if (!file_util::PathExists(private_key_path)) { |
| 124 error_message_ = | 124 error_message_ = |
| 125 l10n_util::GetStringUTF8(IDS_EXTENSION_PRIVATE_KEY_NO_EXISTS); | 125 l10n_util::GetStringUTF8(IDS_EXTENSION_PRIVATE_KEY_NO_EXISTS); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 SignZip(zip_path, key_pair.get(), &signature) && | 320 SignZip(zip_path, key_pair.get(), &signature) && |
| 321 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { | 321 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { |
| 322 result = true; | 322 result = true; |
| 323 } | 323 } |
| 324 | 324 |
| 325 file_util::Delete(zip_path, false); | 325 file_util::Delete(zip_path, false); |
| 326 return result; | 326 return result; |
| 327 } | 327 } |
| 328 | 328 |
| 329 } // namespace extensions | 329 } // namespace extensions |
| OLD | NEW |