From d2817019145d7806d400ae70bf9fb4b5681905c8 Mon Sep 17 00:00:00 2001 From: "aa@chromium.org" Date: Tue, 4 Aug 2009 06:46:21 +0000 Subject: Implement first cut at the extension installation prompt on Windows. Had to move set_path() earlier in the unpack process so that we would have real paths for the resources, so that we could load and display the icon in the ui. This exposed a problem where page actions had absolute paths and other images in extensions had relative paths. Extension::GetBrowserImages() was expecting relative paths, and it just happened to work because in both cases Extension was initialized without a path. Modified page actions to use relative paths to be consistent with other images. Review URL: http://codereview.chromium.org/160516 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22368 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/sandboxed_extension_unpacker.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '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 46a8382..c736f39 100644 --- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc +++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc @@ -119,6 +119,13 @@ void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded( // 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_); + if (!extension_->InitFromValue(*final_manifest, true, // require id &manifest_error)) { ReportFailure(std::string("Manifest is invalid: ") + -- cgit v1.1