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/unpacker.h" | 5 #include "chrome/common/extensions/unpacker.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 std::vector<InstallWarning> warnings; | 190 std::vector<InstallWarning> warnings; |
191 if (!extension_file_util::ValidateExtension(extension.get(), | 191 if (!extension_file_util::ValidateExtension(extension.get(), |
192 &error, &warnings)) { | 192 &error, &warnings)) { |
193 SetError(error); | 193 SetError(error); |
194 return false; | 194 return false; |
195 } | 195 } |
196 extension->AddInstallWarnings(warnings); | 196 extension->AddInstallWarnings(warnings); |
197 | 197 |
198 // Decode any images that the browser needs to display. | 198 // Decode any images that the browser needs to display. |
199 std::set<base::FilePath> image_paths = extension->GetBrowserImages(); | 199 std::set<base::FilePath> image_paths = |
| 200 extension_file_util::GetBrowserImagePaths(extension); |
200 for (std::set<base::FilePath>::iterator it = image_paths.begin(); | 201 for (std::set<base::FilePath>::iterator it = image_paths.begin(); |
201 it != image_paths.end(); ++it) { | 202 it != image_paths.end(); ++it) { |
202 if (!AddDecodedImage(*it)) | 203 if (!AddDecodedImage(*it)) |
203 return false; // Error was already reported. | 204 return false; // Error was already reported. |
204 } | 205 } |
205 | 206 |
206 // Parse all message catalogs (if any). | 207 // Parse all message catalogs (if any). |
207 parsed_catalogs_.reset(new DictionaryValue); | 208 parsed_catalogs_.reset(new DictionaryValue); |
208 if (!LocaleInfo::GetDefaultLocale(extension).empty()) { | 209 if (!LocaleInfo::GetDefaultLocale(extension).empty()) { |
209 if (!ReadAllMessageCatalogs(LocaleInfo::GetDefaultLocale(extension))) | 210 if (!ReadAllMessageCatalogs(LocaleInfo::GetDefaultLocale(extension))) |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 335 |
335 void Unpacker::SetError(const std::string &error) { | 336 void Unpacker::SetError(const std::string &error) { |
336 SetUTF16Error(UTF8ToUTF16(error)); | 337 SetUTF16Error(UTF8ToUTF16(error)); |
337 } | 338 } |
338 | 339 |
339 void Unpacker::SetUTF16Error(const string16 &error) { | 340 void Unpacker::SetUTF16Error(const string16 &error) { |
340 error_message_ = error; | 341 error_message_ = error; |
341 } | 342 } |
342 | 343 |
343 } // namespace extensions | 344 } // namespace extensions |
OLD | NEW |