From ad93c6baf3651dc050ab436bd0cfd84bdabf7127 Mon Sep 17 00:00:00 2001 From: "asargent@chromium.org" Date: Thu, 26 May 2011 04:48:33 +0000 Subject: Change the web store private install API to accept a localized extension name. In our initial design of the beginInstallWithManifest function, we forgot that some extensions have a name which needs token substitution for i18n/l10n. This change renames beginInstallWithManifest to beginInstallWithManifest2, and modifies the signature to take optional localizedName and locale parameters. I also refactored how we compare the passed in manifest used in the pre-download confirmation dialog - we now keep a copy of the source from the .crx file to compare against, since i18n substututions can happen on the manifest we use to construct the Extension object. BUG=75821 TEST=Covered by browser tests for now; will require web store server-side changes before it can be manually tested. Review URL: http://codereview.chromium.org/6992047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86780 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/sandboxed_extension_unpacker.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (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 8e31ddf..b8eb88c 100644 --- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc +++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc @@ -284,7 +284,7 @@ void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded( if (!RewriteCatalogFiles()) return; - ReportSuccess(); + ReportSuccess(manifest); } void SandboxedExtensionUnpacker::OnUnpackExtensionFailed( @@ -480,14 +480,18 @@ void SandboxedExtensionUnpacker::ReportFailure(FailureReason reason, client_->OnUnpackFailure(error); } -void SandboxedExtensionUnpacker::ReportSuccess() { +void SandboxedExtensionUnpacker::ReportSuccess( + const DictionaryValue& original_manifest) { UMA_HISTOGRAM_COUNTS("Extensions.SandboxUnpackSuccess", 1); RecordSuccessfulUnpackTimeHistograms( crx_path_, base::TimeTicks::Now() - unpack_start_time_); // Client takes ownership of temporary directory and extension. - client_->OnUnpackSuccess(temp_dir_.Take(), extension_root_, extension_); + client_->OnUnpackSuccess(temp_dir_.Take(), + extension_root_, + &original_manifest, + extension_); extension_ = NULL; } -- cgit v1.1