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

Issue 1432103002: [MD settings] adding closure compile for settings dropdown menu (and cleaning up) (Closed)

Created:
5 years, 1 month ago by dschuyler
Modified:
5 years, 1 month ago
Reviewers:
michaelpg
CC:
chromium-reviews, michaelpg+watch-md-settings_chromium.org, dcheng, arv+watch_chromium.org, vitalyp+closure_chromium.org, dbeam+watch-settings_chromium.org, dbeam+watch-closure_chromium.org, stevenjb+watch-md-settings_chromium.org, jlklein+watch-closure_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[MD settings] adding closure compile for settings dropdown menu (and cleaning up) This CL adds closure compilation for the settings_dropdown_menu code as well as starting to address some feedback from Michael about the implementation. BUG=425627

Patch Set 1 #

Total comments: 1

Patch Set 2 : fix for prefChanged_ and added underscores to private functions #

Patch Set 3 : corrected some closure types #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -17 lines) Patch
M chrome/browser/resources/settings/controls/compiled_resources.gyp View 2 chunks +18 lines, -2 lines 0 comments Download
M chrome/browser/resources/settings/controls/settings_dropdown_menu.js View 1 2 9 chunks +29 lines, -15 lines 9 comments Download

Dependent Patchsets:

Messages

Total messages: 4 (2 generated)
dschuyler
https://codereview.chromium.org/1432103002/diff/1/chrome/browser/resources/settings/controls/compiled_resources.gyp File chrome/browser/resources/settings/controls/compiled_resources.gyp (right): https://codereview.chromium.org/1432103002/diff/1/chrome/browser/resources/settings/controls/compiled_resources.gyp#newcode22 chrome/browser/resources/settings/controls/compiled_resources.gyp:22: 'target_name': 'settings_dropdown_menu', This is the new entry. The other ...
5 years, 1 month ago (2015-11-10 19:06:18 UTC) #3
michaelpg
5 years, 1 month ago (2015-11-12 23:33:05 UTC) #4
Some questions that led to me writing
https://codereview.chromium.org/1422023012/.

https://codereview.chromium.org/1432103002/diff/40001/chrome/browser/resource...
File chrome/browser/resources/settings/controls/settings_dropdown_menu.js
(right):

https://codereview.chromium.org/1432103002/diff/40001/chrome/browser/resource...
chrome/browser/resources/settings/controls/settings_dropdown_menu.js:24: * in
the settings.
add a sentence explaining the not-found item behavior

https://codereview.chromium.org/1432103002/diff/40001/chrome/browser/resource...
chrome/browser/resources/settings/controls/settings_dropdown_menu.js:132:
result[String(this.menuOptions[i][0])] = i.toString();
btw, I think foo.toString() is more idiomatic than String(foo). I was being dumb
when I suggested String(foo).

https://codereview.chromium.org/1432103002/diff/40001/chrome/browser/resource...
chrome/browser/resources/settings/controls/settings_dropdown_menu.js:140:
this.$.dropdownMenu.disabled = false;
I think disabling the control until the items are available is unnecessary and
will only exacerbate any FOUC. Unless I'm misunderstanding the purpose of this.

https://codereview.chromium.org/1432103002/diff/40001/chrome/browser/resource...
chrome/browser/resources/settings/controls/settings_dropdown_menu.js:140:
this.$.dropdownMenu.disabled = false;
Also, what if I want a <settings-dropdown-menu disabled>? (that property will
probably have to be added soon or later, so we shouldn't override its effects)

https://codereview.chromium.org/1432103002/diff/40001/chrome/browser/resource...
chrome/browser/resources/settings/controls/settings_dropdown_menu.js:152:
this.showNotFoundValue_ = true;
same note from the landed CL: a getter shouldn't add an item to the array, and
this looks like a getter.

https://codereview.chromium.org/1432103002/diff/40001/chrome/browser/resource...
chrome/browser/resources/settings/controls/settings_dropdown_menu.js:154: return
(this.menuOptions.length).toString();
no need for associative parens

https://codereview.chromium.org/1432103002/diff/40001/chrome/browser/resource...
chrome/browser/resources/settings/controls/settings_dropdown_menu.js:164: var
result = this.menuOptions[index];
don't index into an array with a string

https://codereview.chromium.org/1432103002/diff/40001/chrome/browser/resource...
chrome/browser/resources/settings/controls/settings_dropdown_menu.js:178:
this.selectedValue_ = String(prefValue);
toString

https://codereview.chromium.org/1432103002/diff/40001/chrome/browser/resource...
chrome/browser/resources/settings/controls/settings_dropdown_menu.js:189:
this.selectedValue_ = String(value);
toString

Powered by Google App Engine
This is Rietveld 408576698