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

Issue 7741037: Add WebstoreInlineInstaller (downloads store data, shows the install UI, and starts the install). (Closed)

Created:
9 years, 4 months ago by Mihai Parparita -not on Chrome
Modified:
9 years, 3 months ago
CC:
chromium-reviews, Erik does not do reviews, Paweł Hajdan Jr., mihaip+watch_chromium.org, Aaron Boodman, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Add WebstoreInlineInstaller (downloads store data, shows the install UI, and starts the install). The flow is: 1. Fetch store metadata as JSON (using URLFetcher) 2. Parse response in utility process (via SafeWebstoreResponseParser) 3. Parse manifest and get icon data using WebstoreInstallHelper 4. Show install UI 5. Whitelist extension ID for download and start download Still missing are a way of informing the page that the inline install succeeded or failed. Also removes ExtensionTabHelper::GetCustomFrameNativeWindow, since it wasn't actually overriding anything (the method was removed from ExtensionFunctionDispatcher::Delegate by r74835). R=asargent@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98712

Patch Set 1 #

Total comments: 15

Patch Set 2 : Remove GetCustomFrameNativeWindow. #

Patch Set 3 : Review feedback #

Patch Set 4 : Put webstore response in the right directory. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+626 lines, -118 lines) Patch
M chrome/browser/extensions/extension_install_dialog.h View 1 2 3 chunks +26 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_install_dialog.cc View 1 2 1 chunk +74 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_tab_helper.h View 1 4 chunks +12 lines, -7 lines 0 comments Download
M chrome/browser/extensions/extension_tab_helper.cc View 1 3 chunks +12 lines, -22 lines 0 comments Download
M chrome/browser/extensions/extension_webstore_private_api.h View 1 2 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/extensions/extension_webstore_private_api.cc View 1 2 2 chunks +8 lines, -52 lines 0 comments Download
M chrome/browser/extensions/extension_webstore_private_apitest.cc View 1 2 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/webstore_inline_install_browsertest.cc View 1 2 1 chunk +50 lines, -19 lines 0 comments Download
A chrome/browser/extensions/webstore_inline_installer.h View 1 2 1 chunk +100 lines, -0 lines 0 comments Download
A chrome/browser/extensions/webstore_inline_installer.cc View 1 2 1 chunk +293 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_constants.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_constants.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_messages.h View 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/extension_helper.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/extensions/extension_helper.cc View 1 2 2 chunks +14 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/webstore_inline_install/detail/ecglahbcnmdpdciemllbhojghbkagdje View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/extensions/api_test/webstore_inline_install/ecglahbcnmdpdciemllbhojghbkagdje View 1 2 3 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/test/data/extensions/api_test/webstore_inline_install/find_link.html View 3 chunks +5 lines, -5 lines 0 comments Download
M chrome/test/data/extensions/api_test/webstore_inline_install/install.html View 1 chunk +13 lines, -3 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Mihai Parparita -not on Chrome
9 years, 4 months ago (2011-08-25 23:48:18 UTC) #1
Mihai Parparita -not on Chrome
Let me know if this has too many TODOs to land, though I figured the ...
9 years, 4 months ago (2011-08-25 23:49:34 UTC) #2
asargent_no_longer_on_chrome
LGTM w/ some nits & suggestions http://codereview.chromium.org/7741037/diff/1/chrome/browser/extensions/webstore_inline_install_browsertest.cc File chrome/browser/extensions/webstore_inline_install_browsertest.cc (right): http://codereview.chromium.org/7741037/diff/1/chrome/browser/extensions/webstore_inline_install_browsertest.cc#newcode57 chrome/browser/extensions/webstore_inline_install_browsertest.cc:57: GURL GetTestUrl(const std::string& ...
9 years, 4 months ago (2011-08-26 17:50:40 UTC) #3
Mihai Parparita -not on Chrome
9 years, 3 months ago (2011-08-29 19:00:56 UTC) #4
http://codereview.chromium.org/7741037/diff/1/chrome/browser/extensions/webst...
File chrome/browser/extensions/webstore_inline_install_browsertest.cc (right):

http://codereview.chromium.org/7741037/diff/1/chrome/browser/extensions/webst...
chrome/browser/extensions/webstore_inline_install_browsertest.cc:57: GURL
GetTestUrl(const std::string& domain, const std::string& page_filename) {
On 2011/08/26 17:50:40, Antony Sargent wrote:
> There's already a GetTestUrl in ui_test_utils.h that does something similar to
> this, minus the domain replacement. Consider whether it would make sense to
use
> that here, and perhaps change the name of yours to reduce confusion.

GetTestUrl in ui_test_utils returns a file:/// URL for a test file, so it's not
quite appropriate to use here. I've renamed this to GenerateTestServerUrl.

http://codereview.chromium.org/7741037/diff/1/chrome/browser/extensions/webst...
File chrome/browser/extensions/webstore_inline_installer.cc (right):

http://codereview.chromium.org/7741037/diff/1/chrome/browser/extensions/webst...
chrome/browser/extensions/webstore_inline_installer.cc:46: ,
webstore_data_(webstore_data)
On 2011/08/26 17:50:40, Antony Sargent wrote:
> commas in weird place here and line below

Fixed.

http://codereview.chromium.org/7741037/diff/1/chrome/browser/extensions/webst...
chrome/browser/extensions/webstore_inline_installer.cc:136: ,
id_(webstore_item_id)
On 2011/08/26 17:50:40, Antony Sargent wrote:
> commas in weird place here too

Fixed.

http://codereview.chromium.org/7741037/diff/1/chrome/browser/extensions/webst...
chrome/browser/extensions/webstore_inline_installer.cc:143: GURL
webstore_data_url(extension_urls::GetWebstoreItemJsonDataURL(id_));
On 2011/08/26 17:50:40, Antony Sargent wrote:
> It might be good to add a check of Extension::IdIsValid(webstore_item_id) and
> bail out early if it returns false.
>  

Done.

http://codereview.chromium.org/7741037/diff/1/chrome/browser/extensions/webst...
chrome/browser/extensions/webstore_inline_installer.cc:156: void
WebstoreInlineInstaller::SetAutoConfirmForTests(
On 2011/08/26 17:50:40, Antony Sargent wrote:
> add comment with "// static" here

Now that I've refactored the auto-confirm code to be shared with the webstore
private API, this method is no longer needed.

http://codereview.chromium.org/7741037/diff/1/chrome/browser/extensions/webst...
chrome/browser/extensions/webstore_inline_installer.cc:277:
ExtensionInstallUI::INSTALL_PROMPT);
On 2011/08/26 17:50:40, Antony Sargent wrote:
> Do you think it's worth it to extract this code to create the dummy extension
> and put up the install dialog into a common class and share it with the
webstore
> private api? I think we could just pass the Profile, localized name
std::string,
> manifest DictionaryValue, icon SkBitmap and auto_prompt boolean and then get
> called back in InstallUIProceed or InstallUIAbort.

Added ShowExtensionInstallDialogForManifest (the signature wasn't quite the
same, since BeginInstallWithManifestFunction needs to get at the dummy extension
to record some histograms about permissions).

http://codereview.chromium.org/7741037/diff/1/chrome/renderer/extensions/exte...
File chrome/renderer/extensions/extension_helper.cc (right):

http://codereview.chromium.org/7741037/diff/1/chrome/renderer/extensions/exte...
chrome/renderer/extensions/extension_helper.cc:116: LOG(INFO) << "Inline install
succeeded.";
On 2011/08/26 17:50:40, Antony Sargent wrote:
> nit: LOG(INFO) considered harmful (except in cases where you're actively
> tracking down a bug in the field). Prefer VLOG instead.
> 
> ... although I suppose you're going to eventually replace this code anyway
based
> on above TODO. 

Switched to VLOG.

Powered by Google App Engine
This is Rietveld 408576698