Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Issue 6992047: Change the web store private install API to accept a localized extension name. (Closed)

Created:
9 years, 7 months ago by asargent_no_longer_on_chrome
Modified:
9 years, 7 months ago
Reviewers:
Matt Perry
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

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. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86780

Patch Set 1 #

Total comments: 16

Patch Set 2 : addressed comments and fixed unit test compile error #

Patch Set 3 : rebased, removed test files I added in separate CL #

Unified diffs Side-by-side diffs Delta from patch set Stats (+176 lines, -120 lines) Patch
M chrome/browser/extensions/crx_installer.h View 1 2 3 chunks +18 lines, -9 lines 0 comments Download
M chrome/browser/extensions/crx_installer.cc View 1 2 7 chunks +34 lines, -40 lines 0 comments Download
M chrome/browser/extensions/extension_webstore_private_api.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_webstore_private_api.cc View 1 2 6 chunks +35 lines, -6 lines 0 comments Download
M chrome/browser/extensions/extension_webstore_private_apitest.cc View 4 chunks +14 lines, -8 lines 0 comments Download
M chrome/browser/extensions/sandboxed_extension_unpacker.h View 1 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/extensions/sandboxed_extension_unpacker.cc View 2 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/extensions/sandboxed_extension_unpacker_unittest.cc View 1 4 chunks +6 lines, -4 lines 0 comments Download
M chrome/common/extensions/api/extension_api.json View 1 2 1 chunk +31 lines, -17 lines 0 comments Download
M chrome/test/data/extensions/api_test/webstore_private/accepted.js View 2 chunks +12 lines, -19 lines 0 comments Download
M chrome/test/data/extensions/api_test/webstore_private/cancelled.html View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/test/data/extensions/api_test/webstore_private/common.js View 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/webstore_private/incorrect_manifest.js View 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/test/data/extensions/api_test/webstore_private/no_user_gesture.html View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
asargent_no_longer_on_chrome
9 years, 7 months ago (2011-05-25 01:01:17 UTC) #1
Matt Perry
http://codereview.chromium.org/6992047/diff/1/chrome/browser/extensions/crx_installer.cc File chrome/browser/extensions/crx_installer.cc (right): http://codereview.chromium.org/6992047/diff/1/chrome/browser/extensions/crx_installer.cc#newcode355 chrome/browser/extensions/crx_installer.cc:355: #if 0 Remove dead code, unless you mean to ...
9 years, 7 months ago (2011-05-25 01:46:05 UTC) #2
asargent_no_longer_on_chrome
New version up addressing comments. http://codereview.chromium.org/6992047/diff/1/chrome/browser/extensions/crx_installer.cc File chrome/browser/extensions/crx_installer.cc (right): http://codereview.chromium.org/6992047/diff/1/chrome/browser/extensions/crx_installer.cc#newcode355 chrome/browser/extensions/crx_installer.cc:355: #if 0 On 2011/05/25 ...
9 years, 7 months ago (2011-05-25 04:42:00 UTC) #3
Matt Perry
9 years, 7 months ago (2011-05-25 19:03:24 UTC) #4
LGTM

http://codereview.chromium.org/6992047/diff/1/chrome/browser/extensions/crx_i...
File chrome/browser/extensions/crx_installer.cc (right):

http://codereview.chromium.org/6992047/diff/1/chrome/browser/extensions/crx_i...
chrome/browser/extensions/crx_installer.cc:431: if
(!(original_manifest_->Equals(entry->parsed_manifest.get()))) {
On 2011/05/25 04:42:00, Antony Sargent wrote:
> On 2011/05/25 01:46:06, Matt Perry wrote:
> > isn't the Extension::manifest_value supposed to be the original_manifest as
> > contained in the .crx? I don't see why we need to keep this separate copy.
> The Extension::manifest_value has already had a couple of transformations
> applied to it: localization and insertion of the public key field. (See
> SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded).
> 
> What I was doing before, just comparing the extension's manifest_value but
> ignoring the public key field, worked for non-localized extensions but would
> cause comparison failures with any localized fields like name, description,
etc.

Should we also check to ensure that the localized names are the same?

http://codereview.chromium.org/6992047/diff/1/chrome/browser/extensions/exten...
File chrome/browser/extensions/extension_webstore_private_api.h (right):

http://codereview.chromium.org/6992047/diff/1/chrome/browser/extensions/exten...
chrome/browser/extensions/extension_webstore_private_api.h:118:
DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.beginInstallWithManifest2");
On 2011/05/25 04:42:00, Antony Sargent wrote:
> On 2011/05/25 01:46:06, Matt Perry wrote:
> > Why the rename?
> The webstore is still just using the old beginInstall() method that just takes
> an id, and no production code is using the newer but i18n-broken
> beginInstallWithManifest method. Since I changed the method signature in a
> breaking way, to take a details object instead of a list of parameters, I
wanted
> a way they could reliably detect if the newest version of the function was
> available without having to know that my change hit chrome in a specific
version
> and check the user-agent. 

Makes sense. Thanks.

Powered by Google App Engine
This is Rietveld 408576698