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

Issue 7310003: Disable chrome://options UI elements if the corresponding preference is not user-modifiable. (Closed)

Created:
9 years, 5 months ago by Bernhard Bauer
Modified:
9 years, 5 months ago
Reviewers:
Evan Stade
CC:
chromium-reviews, arv (Not doing code reviews), markusheintz_, Joao da Silva
Visibility:
Public.

Description

Disable chrome://options UI elements if the corresponding preference is not user-modifiable. BUG=88341 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=91844

Patch Set 1 #

Total comments: 6

Patch Set 2 : review #

Patch Set 3 : review #

Total comments: 5

Patch Set 4 : review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -45 lines) Patch
M chrome/browser/resources/options/content_settings.html View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/resources/options/content_settings.js View 2 chunks +0 lines, -13 lines 0 comments Download
M chrome/browser/resources/options/pref_ui.js View 1 2 3 1 chunk +17 lines, -12 lines 0 comments Download
M chrome/browser/ui/webui/options/content_settings_handler.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/options/content_settings_handler.cc View 3 chunks +0 lines, -15 lines 0 comments Download
M chrome/browser/ui/webui/options/core_options_handler.cc View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Bernhard Bauer
please review.
9 years, 5 months ago (2011-07-06 12:14:19 UTC) #1
Evan Stade
http://codereview.chromium.org/7310003/diff/1/chrome/browser/resources/options/pref_ui.js File chrome/browser/resources/options/pref_ui.js (right): http://codereview.chromium.org/7310003/diff/1/chrome/browser/resources/options/pref_ui.js#newcode27 chrome/browser/resources/options/pref_ui.js:27: while (node) { use findAncestor from util.js http://codereview.chromium.org/7310003/diff/1/chrome/browser/resources/options/pref_ui.js#newcode38 chrome/browser/resources/options/pref_ui.js:38: ...
9 years, 5 months ago (2011-07-06 19:44:57 UTC) #2
Bernhard Bauer
http://codereview.chromium.org/7310003/diff/1/chrome/browser/resources/options/pref_ui.js File chrome/browser/resources/options/pref_ui.js (right): http://codereview.chromium.org/7310003/diff/1/chrome/browser/resources/options/pref_ui.js#newcode27 chrome/browser/resources/options/pref_ui.js:27: while (node) { On 2011/07/06 19:44:57, Evan Stade wrote: ...
9 years, 5 months ago (2011-07-06 19:55:57 UTC) #3
Evan Stade
http://codereview.chromium.org/7310003/diff/1/chrome/browser/resources/options/pref_ui.js File chrome/browser/resources/options/pref_ui.js (right): http://codereview.chromium.org/7310003/diff/1/chrome/browser/resources/options/pref_ui.js#newcode38 chrome/browser/resources/options/pref_ui.js:38: el.disabled = true; On 2011/07/06 19:55:57, Bernhard Bauer wrote: ...
9 years, 5 months ago (2011-07-06 20:12:43 UTC) #4
Bernhard Bauer
http://codereview.chromium.org/7310003/diff/1/chrome/browser/resources/options/pref_ui.js File chrome/browser/resources/options/pref_ui.js (right): http://codereview.chromium.org/7310003/diff/1/chrome/browser/resources/options/pref_ui.js#newcode38 chrome/browser/resources/options/pref_ui.js:38: el.disabled = true; On 2011/07/06 20:12:43, Evan Stade wrote: ...
9 years, 5 months ago (2011-07-07 08:45:56 UTC) #5
Evan Stade
http://codereview.chromium.org/7310003/diff/6001/chrome/browser/resources/options/pref_ui.js File chrome/browser/resources/options/pref_ui.js (right): http://codereview.chromium.org/7310003/diff/6001/chrome/browser/resources/options/pref_ui.js#newcode31 chrome/browser/resources/options/pref_ui.js:31: null; this will overwrite whatever other title the label ...
9 years, 5 months ago (2011-07-07 20:06:45 UTC) #6
Bernhard Bauer
http://codereview.chromium.org/7310003/diff/6001/chrome/browser/resources/options/pref_ui.js File chrome/browser/resources/options/pref_ui.js (right): http://codereview.chromium.org/7310003/diff/6001/chrome/browser/resources/options/pref_ui.js#newcode31 chrome/browser/resources/options/pref_ui.js:31: null; On 2011/07/07 20:06:45, Evan Stade wrote: > this ...
9 years, 5 months ago (2011-07-07 20:45:11 UTC) #7
Evan Stade
http://codereview.chromium.org/7310003/diff/6001/chrome/browser/resources/options/pref_ui.js File chrome/browser/resources/options/pref_ui.js (right): http://codereview.chromium.org/7310003/diff/6001/chrome/browser/resources/options/pref_ui.js#newcode42 chrome/browser/resources/options/pref_ui.js:42: el.disabled = event.value['disabled']; On 2011/07/07 20:45:14, Bernhard Bauer wrote: ...
9 years, 5 months ago (2011-07-07 21:09:12 UTC) #8
Bernhard Bauer
On 2011/07/07 21:09:12, Evan Stade wrote: > http://codereview.chromium.org/7310003/diff/6001/chrome/browser/resources/options/pref_ui.js > File chrome/browser/resources/options/pref_ui.js (right): > > http://codereview.chromium.org/7310003/diff/6001/chrome/browser/resources/options/pref_ui.js#newcode42 ...
9 years, 5 months ago (2011-07-07 21:33:35 UTC) #9
Evan Stade
9 years, 5 months ago (2011-07-07 21:48:18 UTC) #10
lgtm

-- Evan Stade



On Thu, Jul 7, 2011 at 2:33 PM,  <bauerb@chromium.org> wrote:
> On 2011/07/07 21:09:12, Evan Stade wrote:
>
>
http://codereview.chromium.org/7310003/diff/6001/chrome/browser/resources/opt...
>>
>> File chrome/browser/resources/options/pref_ui.js (right):
>
>
>
http://codereview.chromium.org/7310003/diff/6001/chrome/browser/resources/opt...
>>
>> chrome/browser/resources/options/pref_ui.js:42: el.disabled =
>> event.value['disabled'];
>> On 2011/07/07 20:45:14, Bernhard Bauer wrote:
>> > On 2011/07/07 20:06:45, Evan Stade wrote:
>> > > this still doesn't seem very foolproof.
>> >
>> > I know :-/ This seemed like the easiest way without having to change
>> > every
>> other
>> > place that disables UI elements.
>> >
>> > > reenable could be stale (the preference
>> > > *was* disabled somewhere else, but no longer is). Actually if that
>> > > happens
>> > then
>> > > probably |disabled| has been overwritten elsewhere.
>> >
>> > That would be an error at the other place in the code if it reenables a
>> > UI
>> > element without checking if it was disabled for other reasons,
>
>> but how could the code check if it were disabled for other reasons? That
>> fact
>> isn't stored anywhere, except in 'reenable', and from outside the context
>> of
>> this function that would be a pretty opaque name. Maybe change the name to
>> notUserControlled or something
>
> Sure, I can do that.
>
>> > but I don't think
>> > that happens (most of the time, elements are just disabled, and in that
>> > case
>> > |reenable| defaults to the right value).
>> >
>> > > I don't see an easy way out
>> > > of this... wdyt?
>> >
>> > I think this is at least correct in more cases than the current
>> > behaviour,
>> where
>> > we don't reenable elements at all if they become unmanaged. If there are
>
> cases
>>
>> > where we wrongly reenable elements from other places, we should identify
>> > and
>> fix
>> > them separately.
>
>> I don't know how likely it is to run into this in the wild, so while I
>> agree,
>
> I
>>
>> do not think we should wait for bug reports to roll in.
>
> To put it differently: If bugs of this sort exist, they already exist in the
> current version, so I'm not making things any worse here, I'm just not
> preventing other people from breaking stuff.
>
> http://codereview.chromium.org/7310003/
>

Powered by Google App Engine
This is Rietveld 408576698