Index: chrome/browser/extensions/sandboxed_extension_unpacker.cc |
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc |
index 700313955b0c229501cf41d4b11588e51eef8fdb..184432c8c9a2b728712e548a151466c09dc61a90 100644 |
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc |
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc |
@@ -119,18 +119,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: ") + |
@@ -138,6 +133,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."); |