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

Side by Side Diff: chrome/browser/resources/settings/controls/settings_boolean_control_behavior.js

Issue 2755553002: MD Settings: Fix broken numeric prefs using boolean controls (Closed)
Patch Set: update test Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/settings_toggle_button_tests.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 * A behavior to help controls that handle a boolean preference, such as 7 * A behavior to help controls that handle a boolean preference, such as
8 * checkbox and toggle button. 8 * checkbox and toggle button.
9 */ 9 */
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 }, 56 },
57 57
58 /** 58 /**
59 * For numeric prefs only, the integer value equivalent to the unchecked 59 * For numeric prefs only, the integer value equivalent to the unchecked
60 * state. This is the value sent to prefs if the user unchecks the control. 60 * state. This is the value sent to prefs if the user unchecks the control.
61 * During initialization, the control is unchecked if and only if the pref 61 * During initialization, the control is unchecked if and only if the pref
62 * value is equal to the this value. (Values 2, 3, 4, etc. all are checked.) 62 * value is equal to the this value. (Values 2, 3, 4, etc. all are checked.)
63 */ 63 */
64 numericUncheckedValue: { 64 numericUncheckedValue: {
65 type: Number, 65 type: Number,
66 readOnly: true,
67 value: 0, 66 value: 0,
68 } 67 }
69 }, 68 },
70 69
71 observers: [ 70 observers: [
72 'prefValueChanged_(pref.value)', 71 'prefValueChanged_(pref.value)',
73 ], 72 ],
74 73
75 notifyChangedByUserInteraction: function() { 74 notifyChangedByUserInteraction: function() {
76 this.fire('settings-boolean-control-change'); 75 this.fire('settings-boolean-control-change');
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return this.disabled || this.isPrefEnforced(); 128 return this.disabled || this.isPrefEnforced();
130 }, 129 },
131 }; 130 };
132 131
133 /** @polymerBehavior */ 132 /** @polymerBehavior */
134 var SettingsBooleanControlBehavior = [ 133 var SettingsBooleanControlBehavior = [
135 CrPolicyPrefBehavior, 134 CrPolicyPrefBehavior,
136 PrefControlBehavior, 135 PrefControlBehavior,
137 SettingsBooleanControlBehaviorImpl, 136 SettingsBooleanControlBehaviorImpl,
138 ]; 137 ];
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/settings_toggle_button_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698