summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/options/preferences.js
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 16:00:09 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 16:00:09 +0000
commit73bd67befcb568d52b04984ec9cb75bf216df6c1 (patch)
treeea81be9a4c8036cbe04e8cc28f05f145eb63d70f /chrome/browser/resources/options/preferences.js
parent99739afe82bfcda375aca9c95ab1f69f483b240d (diff)
downloadchromium_src-73bd67befcb568d52b04984ec9cb75bf216df6c1.zip
chromium_src-73bd67befcb568d52b04984ec9cb75bf216df6c1.tar.gz
chromium_src-73bd67befcb568d52b04984ec9cb75bf216df6c1.tar.bz2
Initial accounts options page.
- Add a "Accounts" subpage for ChromeOS; - Two checkboxes for allowing BWSI and allowing guest signin; - Make measureItem in list.js returns 0 instead of -1. The itemHeight is -1 when the list is not visible. And 0 will let redraw to call measureItem again; - Add an onVisibilityChanged callback that is called when "visible" property is changed; And use that to trigger user list's redraw; - Use a mock settings object so that the UI flow could be tested; - Update options_page.css to add a few css missed from dhg's overlay cl; BUG=chromium-os:4734 TEST=None. This is a draft version and will be changed after UX feedbacks. Review URL: http://codereview.chromium.org/2935011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52676 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/options/preferences.js')
-rw-r--r--chrome/browser/resources/options/preferences.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/resources/options/preferences.js b/chrome/browser/resources/options/preferences.js
index db86ea4..cb226bcb 100644
--- a/chrome/browser/resources/options/preferences.js
+++ b/chrome/browser/resources/options/preferences.js
@@ -63,6 +63,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,
@@ -102,7 +112,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 {