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

Issue 1287913005: Refactor prefs.js for MD-Settings (Closed)

Created:
5 years, 4 months ago by michaelpg
Modified:
5 years, 3 months ago
Reviewers:
stevenjb, Dan Beam
CC:
chromium-reviews, khorimoto+watch-md-settings_chromium.org, michaelpg+watch-md-settings_chromium.org, jhawkins+watch-md-settings_chromium.org, orenb+watch-md-settings_chromium.org, arv+watch_chromium.org, stevenjb+watch-md-settings_chromium.org, jlklein+watch-md-settings_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor prefs.js for MD-Settings Motivations: * Make easier to understand and extend. * Eliminate potential infinite loops. * Be more precise and identify error states. * Remove extraneous set() calls (prevent excess Polymer notifications). Assumptions: * Elements should use Polymer.Base.set to update prefs to ensure they propagate. * Preferences should serialize to the same strings in JS and the C++ JSON store. BUG=512479 R=dbeam@chromium.org,stevenjb@chromium.org TBR=stevenjb@chromium.org # because we talked extensively and this shouldn't wait another week Committed: https://crrev.com/037f8fdb34fc72d62d3a78893dc143d870b0d7e5 Cr-Commit-Position: refs/heads/master@{#346747}

Patch Set 1 : #

Total comments: 11

Patch Set 2 : Draft Not For Review #

Total comments: 18

Patch Set 3 : Update after meeting #

Total comments: 57

Patch Set 4 : Feedback #

Total comments: 18

Patch Set 5 : dbeam comments #

Total comments: 19

Patch Set 6 : #

Patch Set 7 : prefs fix #

Patch Set 8 : fix #

Total comments: 7

Patch Set 9 : closure updates #

Total comments: 6

Patch Set 10 : pick up closure pass fix #

Patch Set 11 : formatting #

Patch Set 12 : don't not build on chromeos #

Patch Set 13 : rebase #

Patch Set 14 : whitespace again #

Patch Set 15 : add return after switch for non-clang #

Unified diffs Side-by-side diffs Delta from patch set Stats (+253 lines, -121 lines) Patch
M chrome/browser/extensions/api/settings_private/prefs_util.h View 1 2 3 chunks +13 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/settings_private/prefs_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +18 lines, -15 lines 0 comments Download
M chrome/browser/extensions/api/settings_private/settings_private_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +19 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/settings_private/settings_private_delegate.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/settings_private/settings_private_delegate.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/resources/settings/checkbox/checkbox.js View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/settings/prefs/prefs.html View 1 2 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/resources/settings/prefs/prefs.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +196 lines, -92 lines 0 comments Download
M chrome/browser/resources/settings/settings.html View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 52 (12 generated)
michaelpg
PTAL. https://codereview.chromium.org/1287913005/diff/20001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/20001/chrome/browser/resources/settings/prefs/prefs.js#newcode45 chrome/browser/resources/settings/prefs/prefs.js:45: this.committed_ = {}; Feel free to suggest a ...
5 years, 4 months ago (2015-08-19 02:09:53 UTC) #4
Dan Beam
tl;dr - we should create a factory method returns PrefObject wrappers. that factory method could ...
5 years, 4 months ago (2015-08-19 03:15:38 UTC) #5
stevenjb
https://codereview.chromium.org/1287913005/diff/20001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/20001/chrome/browser/resources/settings/prefs/prefs.js#newcode45 chrome/browser/resources/settings/prefs/prefs.js:45: this.committed_ = {}; On 2015/08/19 02:09:53, michaelpg wrote: > ...
5 years, 4 months ago (2015-08-19 17:26:31 UTC) #6
Dan Beam
https://codereview.chromium.org/1287913005/diff/20001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/20001/chrome/browser/resources/settings/prefs/prefs.js#newcode110 chrome/browser/resources/settings/prefs/prefs.js:110: tokens.forEach(function(token) { On 2015/08/19 17:26:31, stevenjb wrote: > On ...
5 years, 4 months ago (2015-08-19 18:54:12 UTC) #7
michaelpg
On 2015/08/19 03:15:38, Dan Beam wrote: > tl;dr - we should create a factory method ...
5 years, 4 months ago (2015-08-19 21:33:12 UTC) #8
Dan Beam
On 2015/08/19 21:33:12, michaelpg wrote: > On 2015/08/19 03:15:38, Dan Beam wrote: > > tl;dr ...
5 years, 4 months ago (2015-08-19 23:28:44 UTC) #9
Dan Beam
i know you said not for review, but... I'm still confused as to what you're ...
5 years, 4 months ago (2015-08-21 17:13:19 UTC) #10
stevenjb
I admit, I haven't examined or thought through the proposal careful. It might make sense ...
5 years, 4 months ago (2015-08-21 17:35:24 UTC) #11
michaelpg
Agreed: the ui state should always be informed by the C++ prefs model (this can ...
5 years, 4 months ago (2015-08-21 19:40:24 UTC) #12
Dan Beam
On 2015/08/21 19:40:24, michaelpg wrote: > Agreed: the ui state should always be informed by ...
5 years, 4 months ago (2015-08-21 21:50:35 UTC) #13
michaelpg
On Fri, Aug 21, 2015 at 2:50 PM, <dbeam@chromium.org> wrote: > On 2015/08/21 19:40:24, michaelpg ...
5 years, 4 months ago (2015-08-21 22:01:40 UTC) #14
michaelpg
PTAL! These are the high level changes we discussed but the specifics can definitely be ...
5 years, 4 months ago (2015-08-26 06:02:27 UTC) #17
Dan Beam
https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/checkbox/checkbox.js File chrome/browser/resources/settings/checkbox/checkbox.js (right): https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/checkbox/checkbox.js#newcode71 chrome/browser/resources/settings/checkbox/checkbox.js:71: this.set('pref.value', this.getNewValue_(this.checked)); what's the functional difference? this notifies observers? ...
5 years, 3 months ago (2015-08-26 16:51:34 UTC) #18
stevenjb
https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/extensions/api/settings_private/settings_private_api.cc File chrome/browser/extensions/api/settings_private/settings_private_api.cc (right): https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/extensions/api/settings_private/settings_private_api.cc#newcode42 chrome/browser/extensions/api/settings_private/settings_private_api.cc:42: return RespondNow(Error("Error setting pref *", parameters->name)); Since we went ...
5 years, 3 months ago (2015-08-26 17:32:18 UTC) #19
Dan Beam
https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/prefs/prefs.js#newcode31 chrome/browser/resources/settings/prefs/prefs.js:31: * @param {!PrefObject} prefObj On 2015/08/26 17:32:18, stevenjb wrote: ...
5 years, 3 months ago (2015-08-26 17:38:02 UTC) #20
stevenjb
https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/prefs/prefs.js#newcode31 chrome/browser/resources/settings/prefs/prefs.js:31: * @param {!PrefObject} prefObj On 2015/08/26 17:38:01, Dan Beam ...
5 years, 3 months ago (2015-08-26 18:07:09 UTC) #21
Dan Beam
On 2015/08/26 18:07:09, stevenjb wrote: > https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/prefs/prefs.js > File chrome/browser/resources/settings/prefs/prefs.js (right): > > https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/prefs/prefs.js#newcode31 > ...
5 years, 3 months ago (2015-08-26 18:23:16 UTC) #22
stevenjb
On 2015/08/26 18:23:16, Dan Beam wrote: > On 2015/08/26 18:07:09, stevenjb wrote: > > > ...
5 years, 3 months ago (2015-08-26 18:26:50 UTC) #23
Dan Beam
On 2015/08/26 18:26:50, stevenjb wrote: > On 2015/08/26 18:23:16, Dan Beam wrote: > > On ...
5 years, 3 months ago (2015-08-26 18:45:19 UTC) #24
stevenjb
It's not the effort it's the (imho unnecessary) churn. For me, Object implies a Dictionary, ...
5 years, 3 months ago (2015-08-26 18:50:07 UTC) #25
michaelpg
PTAL. https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/extensions/api/settings_private/settings_private_api.cc File chrome/browser/extensions/api/settings_private/settings_private_api.cc (right): https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/extensions/api/settings_private/settings_private_api.cc#newcode42 chrome/browser/extensions/api/settings_private/settings_private_api.cc:42: return RespondNow(Error("Error setting pref *", parameters->name)); On 2015/08/26 ...
5 years, 3 months ago (2015-08-26 23:32:16 UTC) #27
Dan Beam
https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/prefs/prefs.js#newcode30 chrome/browser/resources/settings/prefs/prefs.js:30: * @constructor this might be better as an interface ...
5 years, 3 months ago (2015-08-28 00:08:41 UTC) #28
michaelpg
ptal. https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/80001/chrome/browser/resources/settings/prefs/prefs.js#newcode30 chrome/browser/resources/settings/prefs/prefs.js:30: * @constructor On 2015/08/28 00:08:41, Dan Beam wrote: ...
5 years, 3 months ago (2015-08-28 01:52:48 UTC) #29
Dan Beam
lgtm w/nits + questions https://codereview.chromium.org/1287913005/diff/140001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/140001/chrome/browser/resources/settings/prefs/prefs.js#newcode111 chrome/browser/resources/settings/prefs/prefs.js:111: settingsPrivateWrappers_: { nit: wrappers_ or ...
5 years, 3 months ago (2015-08-28 02:05:36 UTC) #30
stevenjb
https://codereview.chromium.org/1287913005/diff/140001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/140001/chrome/browser/resources/settings/prefs/prefs.js#newcode70 chrome/browser/resources/settings/prefs/prefs.js:70: // Two arrays might have the same values, so ...
5 years, 3 months ago (2015-08-28 17:35:21 UTC) #31
Dan Beam
https://codereview.chromium.org/1287913005/diff/140001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/140001/chrome/browser/resources/settings/prefs/prefs.js#newcode220 chrome/browser/resources/settings/prefs/prefs.js:220: * 'prefs.search.suggest_enabled.value', the key of the pref that changed ...
5 years, 3 months ago (2015-08-28 17:42:05 UTC) #32
michaelpg
https://codereview.chromium.org/1287913005/diff/140001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/140001/chrome/browser/resources/settings/prefs/prefs.js#newcode70 chrome/browser/resources/settings/prefs/prefs.js:70: // Two arrays might have the same values, so ...
5 years, 3 months ago (2015-08-28 18:51:46 UTC) #33
michaelpg
Compare with Patset 5 ("dbeam comments"). https://codereview.chromium.org/1287913005/diff/220001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/220001/chrome/browser/resources/settings/prefs/prefs.js#newcode95 chrome/browser/resources/settings/prefs/prefs.js:95: * @type {Object<PrefWrapper>} ...
5 years, 3 months ago (2015-08-28 20:43:05 UTC) #35
Dan Beam
https://codereview.chromium.org/1287913005/diff/220001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/220001/chrome/browser/resources/settings/prefs/prefs.js#newcode244 chrome/browser/resources/settings/prefs/prefs.js:244: cr.exportPath(newPrefObj.key, newPrefObj, this.prefs); On 2015/08/28 20:43:05, michaelpg wrote: > ...
5 years, 3 months ago (2015-08-28 20:50:05 UTC) #36
michaelpg
https://codereview.chromium.org/1287913005/diff/220001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/220001/chrome/browser/resources/settings/prefs/prefs.js#newcode244 chrome/browser/resources/settings/prefs/prefs.js:244: cr.exportPath(newPrefObj.key, newPrefObj, this.prefs); On 2015/08/28 20:50:05, Dan Beam wrote: ...
5 years, 3 months ago (2015-08-28 20:58:10 UTC) #37
Dan Beam
https://codereview.chromium.org/1287913005/diff/220001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/220001/chrome/browser/resources/settings/prefs/prefs.js#newcode244 chrome/browser/resources/settings/prefs/prefs.js:244: cr.exportPath(newPrefObj.key, newPrefObj, this.prefs); On 2015/08/28 20:58:10, michaelpg wrote: > ...
5 years, 3 months ago (2015-08-28 21:06:56 UTC) #38
michaelpg
dbeam: PTAL -- had to move PrefWrappers outside the closure, and updated ChromePass.java to accept ...
5 years, 3 months ago (2015-08-29 01:26:01 UTC) #39
Dan Beam
On 2015/08/29 01:26:01, michaelpg wrote: > dbeam: PTAL -- had to move PrefWrappers outside the ...
5 years, 3 months ago (2015-08-29 01:44:04 UTC) #40
Dan Beam
lgtm w/pass+runner revert https://codereview.chromium.org/1287913005/diff/240001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/240001/chrome/browser/resources/settings/prefs/prefs.js#newcode36 chrome/browser/resources/settings/prefs/prefs.js:36: /** off https://codereview.chromium.org/1287913005/diff/240001/chrome/browser/resources/settings/prefs/prefs.js#newcode47 chrome/browser/resources/settings/prefs/prefs.js:47: /** also ...
5 years, 3 months ago (2015-08-29 01:49:30 UTC) #41
michaelpg
https://codereview.chromium.org/1287913005/diff/240001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1287913005/diff/240001/chrome/browser/resources/settings/prefs/prefs.js#newcode36 chrome/browser/resources/settings/prefs/prefs.js:36: /** On 2015/08/29 01:49:30, Dan Beam wrote: > off ...
5 years, 3 months ago (2015-08-29 01:53:23 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1287913005/330001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1287913005/330001
5 years, 3 months ago (2015-09-01 16:52:52 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_chromium_compile_only_ng/builds/27215) win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, ...
5 years, 3 months ago (2015-09-01 17:09:47 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1287913005/350001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1287913005/350001
5 years, 3 months ago (2015-09-01 21:15:26 UTC) #50
commit-bot: I haz the power
Committed patchset #15 (id:350001)
5 years, 3 months ago (2015-09-01 22:00:59 UTC) #51
commit-bot: I haz the power
5 years, 3 months ago (2015-09-01 22:01:42 UTC) #52
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/037f8fdb34fc72d62d3a78893dc143d870b0d7e5
Cr-Commit-Position: refs/heads/master@{#346747}

Powered by Google App Engine
This is Rietveld 408576698