diff options
Diffstat (limited to 'chrome/browser/extensions/sandboxed_extension_unpacker.cc')
-rw-r--r-- | chrome/browser/extensions/sandboxed_extension_unpacker.cc | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc index 9d043b7..8756450 100644 --- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc +++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc @@ -127,18 +127,13 @@ void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded( return; } - // Delete any images that may be used by the browser. We're going to write - // out our own versions of the parsed images, and we want to make sure the - // originals are gone for good. - extension_.reset(new Extension); - std::string manifest_error; - - // Update the path to refer to the temporary location. We do this because - // clients may want to use resources inside the extension before it is - // installed and they need the correct path. For example, the install UI shows - // one of the icons from the extension. - extension_->set_path(extension_root_); + // Create an extension object that refers to the temporary location the + // extension was unpacked to. We use this until the extension is finally + // installed. For example, the install UI shows images from inside the + // extension. + extension_.reset(new Extension(extension_root_)); + std::string manifest_error; if (!extension_->InitFromValue(*final_manifest, true, // require id &manifest_error)) { ReportFailure(std::string("Manifest is invalid: ") + @@ -146,6 +141,9 @@ void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded( return; } + // Delete any images that may be used by the browser. We're going to write + // out our own versions of the parsed images, and we want to make sure the + // originals are gone for good. std::set<FilePath> image_paths = extension_->GetBrowserImages(); if (image_paths.size() != images.size()) { ReportFailure("Decoded images don't match what's in the manifest."); |