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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 return key_pair; | 192 return key_pair; |
193 } | 193 } |
194 | 194 |
195 bool ExtensionCreator::CreateZip(const base::FilePath& extension_dir, | 195 bool ExtensionCreator::CreateZip(const base::FilePath& extension_dir, |
196 const base::FilePath& temp_path, | 196 const base::FilePath& temp_path, |
197 base::FilePath* zip_path) { | 197 base::FilePath* zip_path) { |
198 *zip_path = temp_path.Append(FILE_PATH_LITERAL("extension.zip")); | 198 *zip_path = temp_path.Append(FILE_PATH_LITERAL("extension.zip")); |
199 | 199 |
200 scoped_refptr<ExtensionCreatorFilter> filter = new ExtensionCreatorFilter(); | 200 scoped_refptr<ExtensionCreatorFilter> filter = new ExtensionCreatorFilter(); |
201 const base::Callback<bool(const base::FilePath&)>& filter_cb = | 201 const base::Callback<bool(const base::FilePath&)>& filter_cb = |
202 base::Bind(&ExtensionCreatorFilter::ShouldPackageFile, filter.get()); | 202 base::Bind(&ExtensionCreatorFilter::ShouldPackageFile, filter); |
203 if (!zip::ZipWithFilterCallback(extension_dir, *zip_path, filter_cb)) { | 203 if (!zip::ZipWithFilterCallback(extension_dir, *zip_path, filter_cb)) { |
204 error_message_ = | 204 error_message_ = |
205 l10n_util::GetStringUTF8(IDS_EXTENSION_FAILED_DURING_PACKAGING); | 205 l10n_util::GetStringUTF8(IDS_EXTENSION_FAILED_DURING_PACKAGING); |
206 return false; | 206 return false; |
207 } | 207 } |
208 | 208 |
209 return true; | 209 return true; |
210 } | 210 } |
211 | 211 |
212 bool ExtensionCreator::SignZip(const base::FilePath& zip_path, | 212 bool ExtensionCreator::SignZip(const base::FilePath& zip_path, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |