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

Unified Diff: chrome/browser/resources/settings/prefs/prefs.js

Issue 1132223005: Fix the pref binding by binding to the object rather than the element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fixes
Patch Set: ::change Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/prefs/prefs.js
diff --git a/chrome/browser/resources/settings/prefs/prefs.js b/chrome/browser/resources/settings/prefs/prefs.js
index 4ad71288833ea9cc15e8e5261e48991773e51f84..febc22d41b1e70e46394148759d257e9ffb05762 100644
--- a/chrome/browser/resources/settings/prefs/prefs.js
+++ b/chrome/browser/resources/settings/prefs/prefs.js
@@ -26,7 +26,7 @@
/**
* Object containing all preferences.
*/
- settings: {
+ prefStore: {
type: Object,
value: function() { return {}; },
notify: true,
@@ -74,7 +74,7 @@
*/
updatePrefs_: function(prefs, shouldObserve) {
prefs.forEach(function(prefObj) {
- let root = this.settings;
+ let root = this.prefStore;
let tokens = prefObj.key.split('.');
assert(tokens.length > 0);
@@ -83,7 +83,7 @@
let token = tokens[i];
if (!root.hasOwnProperty(token)) {
- let path = 'settings.' + tokens.slice(0, i + 1).join('.');
+ let path = 'prefStore.' + tokens.slice(0, i + 1).join('.');
this.setPathValue(path, {});
}
root = root[token];
@@ -92,7 +92,7 @@
// NOTE: Do this copy rather than just a re-assignment, so that the
// ObjectObserver fires.
for (let objKey in prefObj) {
- let path = 'settings.' + prefObj.key + '.' + objKey;
+ let path = 'prefStore.' + prefObj.key + '.' + objKey;
this.setPathValue(path, prefObj[objKey]);
}

Powered by Google App Engine
This is Rietveld 408576698