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 "extensions/utility/unpacker.h" | 5 #include "extensions/utility/unpacker.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 std::vector<InstallWarning> warnings; | 180 std::vector<InstallWarning> warnings; |
181 if (!file_util::ValidateExtension(extension.get(), &error, &warnings)) { | 181 if (!file_util::ValidateExtension(extension.get(), &error, &warnings)) { |
182 SetError(error); | 182 SetError(error); |
183 return false; | 183 return false; |
184 } | 184 } |
185 extension->AddInstallWarnings(warnings); | 185 extension->AddInstallWarnings(warnings); |
186 | 186 |
187 // Decode any images that the browser needs to display. | 187 // Decode any images that the browser needs to display. |
188 std::set<base::FilePath> image_paths = | 188 std::set<base::FilePath> image_paths = |
189 ExtensionsClient::Get()->GetBrowserImagePaths(extension.get()); | 189 ExtensionsClient::Get()->GetBrowserImagePaths(extension.get()); |
190 for (const base::FilePath& path : image_paths) { | 190 for (std::set<base::FilePath>::iterator it = image_paths.begin(); |
191 if (!AddDecodedImage(path)) | 191 it != image_paths.end(); ++it) { |
| 192 if (!AddDecodedImage(*it)) |
192 return false; // Error was already reported. | 193 return false; // Error was already reported. |
193 } | 194 } |
194 | 195 |
195 // Parse all message catalogs (if any). | 196 // Parse all message catalogs (if any). |
196 parsed_catalogs_.reset(new base::DictionaryValue); | 197 parsed_catalogs_.reset(new base::DictionaryValue); |
197 if (!LocaleInfo::GetDefaultLocale(extension.get()).empty()) { | 198 if (!LocaleInfo::GetDefaultLocale(extension.get()).empty()) { |
198 if (!ReadAllMessageCatalogs(LocaleInfo::GetDefaultLocale(extension.get()))) | 199 if (!ReadAllMessageCatalogs(LocaleInfo::GetDefaultLocale(extension.get()))) |
199 return false; // Error was already reported. | 200 return false; // Error was already reported. |
200 } | 201 } |
201 | 202 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 290 |
290 void Unpacker::SetError(const std::string& error) { | 291 void Unpacker::SetError(const std::string& error) { |
291 SetUTF16Error(base::UTF8ToUTF16(error)); | 292 SetUTF16Error(base::UTF8ToUTF16(error)); |
292 } | 293 } |
293 | 294 |
294 void Unpacker::SetUTF16Error(const base::string16& error) { | 295 void Unpacker::SetUTF16Error(const base::string16& error) { |
295 error_message_ = error; | 296 error_message_ = error; |
296 } | 297 } |
297 | 298 |
298 } // namespace extensions | 299 } // namespace extensions |
OLD | NEW |