| 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/common/extensions/extension_file_util.h" | 5 #include "chrome/common/extensions/extension_file_util.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 scoped_refptr<Extension> LoadExtension(const FilePath& extension_path, | 134 scoped_refptr<Extension> LoadExtension(const FilePath& extension_path, |
| 135 const std::string& extension_id, | 135 const std::string& extension_id, |
| 136 Extension::Location location, | 136 Extension::Location location, |
| 137 int flags, | 137 int flags, |
| 138 std::string* error) { | 138 std::string* error) { |
| 139 scoped_ptr<DictionaryValue> manifest(LoadManifest(extension_path, error)); | 139 scoped_ptr<DictionaryValue> manifest(LoadManifest(extension_path, error)); |
| 140 if (!manifest.get()) | 140 if (!manifest.get()) |
| 141 return NULL; | 141 return NULL; |
| 142 if (!extension_l10n_util::LocalizeExtension(extension_path, manifest.get(), | 142 if (!extension_l10n_util::LocalizeExtension(extension_path, manifest.get(), |
| 143 error)) | 143 error)) { |
| 144 return NULL; | 144 return NULL; |
| 145 } |
| 145 | 146 |
| 146 scoped_refptr<Extension> extension(Extension::Create(extension_path, | 147 scoped_refptr<Extension> extension(Extension::Create(extension_path, |
| 147 location, | 148 location, |
| 148 *manifest, | 149 *manifest, |
| 149 flags, | 150 flags, |
| 150 extension_id, | 151 extension_id, |
| 151 error)); | 152 error)); |
| 152 if (!extension.get()) | 153 if (!extension.get()) |
| 153 return NULL; | 154 return NULL; |
| 154 | 155 |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 return temp_path; | 773 return temp_path; |
| 773 | 774 |
| 774 return FilePath(); | 775 return FilePath(); |
| 775 } | 776 } |
| 776 | 777 |
| 777 void DeleteFile(const FilePath& path, bool recursive) { | 778 void DeleteFile(const FilePath& path, bool recursive) { |
| 778 file_util::Delete(path, recursive); | 779 file_util::Delete(path, recursive); |
| 779 } | 780 } |
| 780 | 781 |
| 781 } // namespace extension_file_util | 782 } // namespace extension_file_util |
| OLD | NEW |