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

Side by Side Diff: chrome/browser/resources/settings/prefs/prefs.js

Issue 1131793002: Upgrade checkbox, pref-tracker, and prefs to 0.8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@crelements
Patch Set: update settings_resources.grd 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 unified diff | Download patch
OLDNEW
1 /* Copyright 2015 The Chromium Authors. All rights reserved. 1 /* Copyright 2015 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. */ 3 * found in the LICENSE file. */
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'cr-settings-prefs' is an element which serves as a model for 7 * 'cr-settings-prefs' is an element which serves as a model for
8 * interaction with settings which are stored in Chrome's 8 * interaction with settings which are stored in Chrome's
9 * Preferences. 9 * Preferences.
10 * 10 *
11 * Example: 11 * Example:
12 * 12 *
13 * <cr-settings-prefs id="prefs"></cr-settings-prefs> 13 * <cr-settings-prefs id="prefs"></cr-settings-prefs>
14 * <cr-settings-a11y-page prefs="{{this.$.prefs}}"></cr-settings-a11y-page> 14 * <cr-settings-a11y-page prefs="{{this.$.prefs}}"></cr-settings-a11y-page>
15 * 15 *
16 * @group Chrome Settings Elements 16 * @group Chrome Settings Elements
17 * @element cr-settings-a11y-page 17 * @element cr-settings-a11y-page
18 */ 18 */
19 (function() { 19 (function() {
20 'use strict'; 20 'use strict';
21 21
22 Polymer('cr-settings-prefs', { 22 Polymer({
23 publish: { 23 is: 'cr-settings-prefs',
24
25 properties: {
24 /** 26 /**
25 * Object containing all preferences. 27 * Object containing all preferences.
26 *
27 * @attribute settings
28 * @type {Object}
29 * @default null
30 */ 28 */
31 settings: null, 29 settings: {
30 type: Object,
31 value: function() { return {}; },
32 notify: true,
33 },
32 }, 34 },
33 35
34 /** @override */ 36 /** @override */
35 created: function() { 37 created: function() {
36 CrSettingsPrefs.isInitialized = false; 38 CrSettingsPrefs.isInitialized = false;
37 this.settings = {};
38 39
39 chrome.settingsPrivate.onPrefsChanged.addListener( 40 chrome.settingsPrivate.onPrefsChanged.addListener(
40 this.onPrefsChanged_.bind(this)); 41 this.onPrefsChanged_.bind(this));
41 chrome.settingsPrivate.getAllPrefs(this.onPrefsFetched_.bind(this)); 42 chrome.settingsPrivate.getAllPrefs(this.onPrefsFetched_.bind(this));
42 }, 43 },
43 44
44 /** 45 /**
45 * Called when prefs in the underlying Chrome pref store are changed. 46 * Called when prefs in the underlying Chrome pref store are changed.
46 * @param {!Array<!chrome.settingsPrivate.PrefObject>} prefs The prefs that 47 * @param {!Array<!chrome.settingsPrivate.PrefObject>} prefs The prefs that
47 * changed. 48 * changed.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 125
125 chrome.settingsPrivate.setPref( 126 chrome.settingsPrivate.setPref(
126 propertyPath, 127 propertyPath,
127 newValue, 128 newValue,
128 /* pageId */ '', 129 /* pageId */ '',
129 /* callback */ function() {}); 130 /* callback */ function() {});
130 } 131 }
131 }, 132 },
132 }); 133 });
133 })(); 134 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/prefs/prefs.html ('k') | chrome/browser/resources/settings/settings_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698