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

Unified Diff: chrome/browser/resources/options/preferences.js

Issue 2935011: Initial accounts options page. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: use ListItem directly for now per arv Created 10 years, 5 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/options/preferences.js
diff --git a/chrome/browser/resources/options/preferences.js b/chrome/browser/resources/options/preferences.js
index 12ff304566be00df7ee48f537ded94665a2f4c04..059b6b42b4320805fd67c4667174bdf836c314d5 100644
--- a/chrome/browser/resources/options/preferences.js
+++ b/chrome/browser/resources/options/preferences.js
@@ -73,6 +73,16 @@ Preferences.setStringPref = function(name, value) {
chrome.send('setStringPref', [name, value]);
};
+/**
+ * Sets value of a JSON preference.
+ * and signals its changed value.
+ * @param {string} name Preference name.
+ * @param {string} value New preference value.
+ */
+Preferences.setObjectPref = function(name, value) {
+ chrome.send('setObjectPref', [name, JSON.stringify(value)]);
+};
+
Preferences.prototype = {
__proto__: cr.EventTarget.prototype,
@@ -112,7 +122,8 @@ Preferences.prototype = {
*/
flattenMapAndDispatchEvent_: function(prefix, dict) {
for (var prefName in dict) {
- if (typeof dict[prefName] == 'object') {
+ if (typeof dict[prefName] == 'object' &&
+ !this.registeredPreferences_[prefix + prefName]) {
this.flattenMapAndDispatchEvent_(prefix + prefName + '.',
dict[prefName]);
} else {
« no previous file with comments | « chrome/browser/resources/options/options_page.js ('k') | chrome/browser/resources/shared/js/cr/ui/array_data_model.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698