| Index: chrome/browser/resources/settings/controls/settings_boolean_control_behavior.js
|
| diff --git a/chrome/browser/resources/settings/controls/settings_checkbox.js b/chrome/browser/resources/settings/controls/settings_boolean_control_behavior.js
|
| similarity index 73%
|
| copy from chrome/browser/resources/settings/controls/settings_checkbox.js
|
| copy to chrome/browser/resources/settings/controls/settings_boolean_control_behavior.js
|
| index 7dabd988baf2a41c04b32c49eded167d94c02cf7..c33553b68b6d6fabe226f6be2493f17aac81d4e3 100644
|
| --- a/chrome/browser/resources/settings/controls/settings_checkbox.js
|
| +++ b/chrome/browser/resources/settings/controls/settings_boolean_control_behavior.js
|
| @@ -1,29 +1,23 @@
|
| -// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| /**
|
| * @fileoverview
|
| - * `settings-checkbox` is a checkbox that controls a supplied preference.
|
| - *
|
| - * Example:
|
| - * <settings-checkbox pref="{{prefs.settings.enableFoo}}"
|
| - * label="Enable foo setting." subLabel="(bar also)">
|
| - * </settings-checkbox>
|
| + * A behavior to help controls that handle a boolean preference, such as
|
| + * checkbox and toggle button.
|
| */
|
| -Polymer({
|
| - is: 'settings-checkbox',
|
| -
|
| - behaviors: [CrPolicyPrefBehavior, PrefControlBehavior],
|
|
|
| +/** @polymerBehavior SettingsBooleanControlBehavior */
|
| +var SettingsBooleanControlBehaviorImpl = {
|
| properties: {
|
| - /** Whether the checkbox should represent the inverted value. */
|
| + /** Whether the control should represent the inverted value. */
|
| inverted: {
|
| type: Boolean,
|
| value: false,
|
| },
|
|
|
| - /** Whether the checkbox is checked. */
|
| + /** Whether the control is checked. */
|
| checked: {
|
| type: Boolean,
|
| value: false,
|
| @@ -40,13 +34,13 @@ Polymer({
|
| reflectToAttribute: true
|
| },
|
|
|
| - /** Checkbox label. */
|
| + /** The main label. */
|
| label: {
|
| type: String,
|
| value: '',
|
| },
|
|
|
| - /** Additional sub-label for the checkbox. */
|
| + /** Additional (optional) sub-label. */
|
| subLabel: {
|
| type: String,
|
| value: '',
|
| @@ -98,7 +92,14 @@ Polymer({
|
| * @return {boolean} Whether the checkbox should be disabled.
|
| * @private
|
| */
|
| - checkboxDisabled_: function(disabled, pref) {
|
| + controlDisabled_: function(disabled, pref) {
|
| return disabled || this.isPrefPolicyControlled(pref);
|
| },
|
| -});
|
| +};
|
| +
|
| +/** @polymerBehavior */
|
| +var SettingsBooleanControlBehavior = [
|
| + CrPolicyPrefBehavior,
|
| + PrefControlBehavior,
|
| + SettingsBooleanControlBehaviorImpl,
|
| +];
|
|
|