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

Issue 1920153002: Fix an issue in checkbox handler to enable extension. (Closed)

Created:
4 years, 7 months ago by lazyboy
Modified:
4 years, 7 months ago
Reviewers:
Devlin, Dan Beam
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, arv+watch_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix an issue in checkbox handler to enable extension. The code is supposed to preventDefault() always and update the checkbox's state when enabling/disabling result comes back from management API call. However, this uses <input>'s onchange event handler to preventDefault() and onchange event is not cancelable (https://developer.mozilla.org/en-US/docs/Web/Events/change), so calling preventDefault() has no effect. This regressed in https://codereview.chromium.org/893453002/diff/300001/chrome/browser/resources/extensions/extension_list.js as I understand. The issue is a bit serious when user tries to enable a permission increased extension. Enabling permission increased extension results in showing a "Re-enable" prompt. Because the preventDefault() code was busted, it will keep showing that the extension is "Enabled" even if you cancel the "Re-enable" prompt. This CL fixes the issue. BUG=607353 Test=a) Update an extension so it has more permissions now and it shows "extension was disabled due to permission increase" warning. b) Try to enable the extension from chrome://extensions, it will show you a "Cancel"/"Re-enable" prompt. c) Hit "Cancel". Without this change, you'd see that extension's Enable checkbox gets checked incorrectly. With this CL, you'd see that the "Enable" checkbox stays unchecked. I've also tested enabling extension with: a. click/mousedown with a mouse on desktop b. tap on chromebook pixel c. screenreader: with OSX voiceover. (cmd+f5 to turn on voice over, tab to select the checkbox, ctrl+option+space to select/deselect the checkbox). d. keyboard: focus the checkbox and press space. In *all* of the above cases, a "click" event gets dispatched, so this should not break anything. Committed: https://crrev.com/bb4de91c987389a932a7f0b9afad8f4031efaa9b Cr-Commit-Position: refs/heads/master@{#390252}

Patch Set 1 #

Total comments: 2

Patch Set 2 : add TODO back #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -2 lines) Patch
M chrome/browser/resources/extensions/extension_list.js View 1 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 18 (7 generated)
lazyboy
I couldn't find any related crbug, do you know of any?
4 years, 7 months ago (2016-04-26 01:38:23 UTC) #2
Devlin
+Dan from that original review - it looks like he requested the change here: https://codereview.chromium.org/893453002/diff/200001/chrome/browser/resources/extensions/extension_list.js. ...
4 years, 7 months ago (2016-04-26 14:24:48 UTC) #4
Dan Beam
On 2016/04/26 14:24:48, Devlin wrote: > +Dan from that original review - it looks like ...
4 years, 7 months ago (2016-04-27 02:31:34 UTC) #5
Devlin
lgtm as long as the tests Dan mentioned pass. https://codereview.chromium.org/1920153002/diff/1/chrome/browser/resources/extensions/extension_list.js File chrome/browser/resources/extensions/extension_list.js (left): https://codereview.chromium.org/1920153002/diff/1/chrome/browser/resources/extensions/extension_list.js#oldcode553 chrome/browser/resources/extensions/extension_list.js:553: ...
4 years, 7 months ago (2016-04-27 13:52:01 UTC) #6
lazyboy
I've checked [1] that 'click' event is dispatched with mouse, tap (chromeos pixel) and keyboard. ...
4 years, 7 months ago (2016-04-27 22:12:55 UTC) #7
Dan Beam
On 2016/04/27 22:12:55, lazyboy wrote: > I've checked [1] that 'click' event is dispatched with ...
4 years, 7 months ago (2016-04-27 22:39:41 UTC) #8
lazyboy
On 2016/04/27 22:39:41, Dan Beam wrote: > On 2016/04/27 22:12:55, lazyboy wrote: > > I've ...
4 years, 7 months ago (2016-04-27 23:14:10 UTC) #10
Dan Beam
lgtm
4 years, 7 months ago (2016-04-28 00:00:20 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1920153002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1920153002/20001
4 years, 7 months ago (2016-04-28 00:17:02 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 7 months ago (2016-04-28 00:27:13 UTC) #16
commit-bot: I haz the power
4 years, 7 months ago (2016-04-30 17:14:56 UTC) #17
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/bb4de91c987389a932a7f0b9afad8f4031efaa9b
Cr-Commit-Position: refs/heads/master@{#390252}

Powered by Google App Engine
This is Rietveld 408576698