| 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/files/file_enumerator.h" | 9 #include "base/files/file_enumerator.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 SkBitmap image_bitmap = DecodeImage(temp_install_dir_.Append(path)); | 258 SkBitmap image_bitmap = DecodeImage(temp_install_dir_.Append(path)); |
| 259 if (image_bitmap.isNull()) { | 259 if (image_bitmap.isNull()) { |
| 260 SetUTF16Error(l10n_util::GetStringFUTF16( | 260 SetUTF16Error(l10n_util::GetStringFUTF16( |
| 261 IDS_EXTENSION_PACKAGE_IMAGE_ERROR, | 261 IDS_EXTENSION_PACKAGE_IMAGE_ERROR, |
| 262 base::i18n::GetDisplayStringInLTRDirectionality( | 262 base::i18n::GetDisplayStringInLTRDirectionality( |
| 263 path.BaseName().LossyDisplayName()))); | 263 path.BaseName().LossyDisplayName()))); |
| 264 return false; | 264 return false; |
| 265 } | 265 } |
| 266 | 266 |
| 267 internal_data_->decoded_images.push_back(MakeTuple(image_bitmap, path)); | 267 internal_data_->decoded_images.push_back(base::MakeTuple(image_bitmap, path)); |
| 268 return true; | 268 return true; |
| 269 } | 269 } |
| 270 | 270 |
| 271 bool Unpacker::ReadMessageCatalog(const base::FilePath& message_path) { | 271 bool Unpacker::ReadMessageCatalog(const base::FilePath& message_path) { |
| 272 std::string error; | 272 std::string error; |
| 273 JSONFileValueDeserializer deserializer(message_path); | 273 JSONFileValueDeserializer deserializer(message_path); |
| 274 scoped_ptr<base::DictionaryValue> root(static_cast<base::DictionaryValue*>( | 274 scoped_ptr<base::DictionaryValue> root(static_cast<base::DictionaryValue*>( |
| 275 deserializer.Deserialize(NULL, &error))); | 275 deserializer.Deserialize(NULL, &error))); |
| 276 if (!root.get()) { | 276 if (!root.get()) { |
| 277 base::string16 messages_file = message_path.LossyDisplayName(); | 277 base::string16 messages_file = message_path.LossyDisplayName(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 305 | 305 |
| 306 void Unpacker::SetError(const std::string& error) { | 306 void Unpacker::SetError(const std::string& error) { |
| 307 SetUTF16Error(base::UTF8ToUTF16(error)); | 307 SetUTF16Error(base::UTF8ToUTF16(error)); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void Unpacker::SetUTF16Error(const base::string16& error) { | 310 void Unpacker::SetUTF16Error(const base::string16& error) { |
| 311 error_message_ = error; | 311 error_message_ = error; |
| 312 } | 312 } |
| 313 | 313 |
| 314 } // namespace extensions | 314 } // namespace extensions |
| OLD | NEW |