| 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 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool ExtensionCreator::InitializeInput( | 36 bool ExtensionCreator::InitializeInput( |
| 37 const base::FilePath& extension_dir, | 37 const base::FilePath& extension_dir, |
| 38 const base::FilePath& crx_path, | 38 const base::FilePath& crx_path, |
| 39 const base::FilePath& private_key_path, | 39 const base::FilePath& private_key_path, |
| 40 const base::FilePath& private_key_output_path, | 40 const base::FilePath& private_key_output_path, |
| 41 int run_flags) { | 41 int run_flags) { |
| 42 // Validate input |extension_dir|. | 42 // Validate input |extension_dir|. |
| 43 if (extension_dir.value().empty() || | 43 if (extension_dir.value().empty() || |
| 44 !file_util::DirectoryExists(extension_dir)) { | 44 !base::DirectoryExists(extension_dir)) { |
| 45 error_message_ = | 45 error_message_ = |
| 46 l10n_util::GetStringUTF8(IDS_EXTENSION_DIRECTORY_NO_EXISTS); | 46 l10n_util::GetStringUTF8(IDS_EXTENSION_DIRECTORY_NO_EXISTS); |
| 47 return false; | 47 return false; |
| 48 } | 48 } |
| 49 | 49 |
| 50 base::FilePath absolute_extension_dir = | 50 base::FilePath absolute_extension_dir = |
| 51 base::MakeAbsoluteFilePath(extension_dir); | 51 base::MakeAbsoluteFilePath(extension_dir); |
| 52 if (absolute_extension_dir.empty()) { | 52 if (absolute_extension_dir.empty()) { |
| 53 error_message_ = | 53 error_message_ = |
| 54 l10n_util::GetStringUTF8(IDS_EXTENSION_CANT_GET_ABSOLUTE_PATH); | 54 l10n_util::GetStringUTF8(IDS_EXTENSION_CANT_GET_ABSOLUTE_PATH); |
| (...skipping 265 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 base::Delete(zip_path, false); | 325 base::Delete(zip_path, false); |
| 326 return result; | 326 return result; |
| 327 } | 327 } |
| 328 | 328 |
| 329 } // namespace extensions | 329 } // namespace extensions |
| OLD | NEW |