| 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/sandboxed_unpacker.h" | 5 #include "chrome/browser/extensions/sandboxed_unpacker.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 COULD_NOT_READ_IMAGE_DATA_FROM_DISK, | 634 COULD_NOT_READ_IMAGE_DATA_FROM_DISK, |
| 635 l10n_util::GetStringFUTF16( | 635 l10n_util::GetStringFUTF16( |
| 636 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, | 636 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, |
| 637 ASCIIToUTF16("COULD_NOT_READ_IMAGE_DATA_FROM_DISK"))); | 637 ASCIIToUTF16("COULD_NOT_READ_IMAGE_DATA_FROM_DISK"))); |
| 638 return false; | 638 return false; |
| 639 } | 639 } |
| 640 | 640 |
| 641 // Delete any images that may be used by the browser. We're going to write | 641 // Delete any images that may be used by the browser. We're going to write |
| 642 // out our own versions of the parsed images, and we want to make sure the | 642 // out our own versions of the parsed images, and we want to make sure the |
| 643 // originals are gone for good. | 643 // originals are gone for good. |
| 644 std::set<base::FilePath> image_paths = extension_->GetBrowserImages(); | 644 std::set<base::FilePath> image_paths = |
| 645 extension_file_util::GetBrowserImagePaths(extension_); |
| 645 if (image_paths.size() != images.size()) { | 646 if (image_paths.size() != images.size()) { |
| 646 // Decoded images don't match what's in the manifest. | 647 // Decoded images don't match what's in the manifest. |
| 647 ReportFailure( | 648 ReportFailure( |
| 648 DECODED_IMAGES_DO_NOT_MATCH_THE_MANIFEST, | 649 DECODED_IMAGES_DO_NOT_MATCH_THE_MANIFEST, |
| 649 l10n_util::GetStringFUTF16( | 650 l10n_util::GetStringFUTF16( |
| 650 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, | 651 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, |
| 651 ASCIIToUTF16("DECODED_IMAGES_DO_NOT_MATCH_THE_MANIFEST"))); | 652 ASCIIToUTF16("DECODED_IMAGES_DO_NOT_MATCH_THE_MANIFEST"))); |
| 652 return false; | 653 return false; |
| 653 } | 654 } |
| 654 | 655 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 | 796 |
| 796 void SandboxedUnpacker::Cleanup() { | 797 void SandboxedUnpacker::Cleanup() { |
| 797 DCHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); | 798 DCHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); |
| 798 if (!temp_dir_.Delete()) { | 799 if (!temp_dir_.Delete()) { |
| 799 LOG(WARNING) << "Can not delete temp directory at " | 800 LOG(WARNING) << "Can not delete temp directory at " |
| 800 << temp_dir_.path().value(); | 801 << temp_dir_.path().value(); |
| 801 } | 802 } |
| 802 } | 803 } |
| 803 | 804 |
| 804 } // namespace extensions | 805 } // namespace extensions |
| OLD | NEW |