Chromium Code Reviews| Index: chrome/browser/resources/options/pref_ui.js |
| diff --git a/chrome/browser/resources/options/pref_ui.js b/chrome/browser/resources/options/pref_ui.js |
| index a4a1127c75defebe4b85a0c60d37b4d15cf065aa..b97abaef34b43098ec2e3217687cc861ee6813aa 100644 |
| --- a/chrome/browser/resources/options/pref_ui.js |
| +++ b/chrome/browser/resources/options/pref_ui.js |
| @@ -390,7 +390,21 @@ cr.define('options', function() { |
| PrefSelect.prototype = { |
| // Set up the prototype chain |
| - __proto__: PrefInputElement.prototype, |
| + __proto__: HTMLSelectElement.prototype, |
|
Dan Beam
2015/04/20 15:06:26
keep in mind that settings is being rewritten acti
arv (Not doing code reviews)
2015/04/24 14:22:45
With ES6 you can do traits.
function PrefTrait(su
Yuki
2015/04/27 09:22:38
Looks cool to me. I defer this re-design task to
|
| + |
| + /** |
| + * Initialization function for the cr.ui framework. |
| + */ |
| + decorate: PrefInputElement.prototype.decorate, |
| + |
| + /** |
| + * Handle changes to the input element's state made by the user. If a custom |
| + * change handler does not suppress it, a default handler is invoked that |
| + * updates the associated pref. |
| + * @param {Event} event Change event. |
| + * @protected |
| + */ |
| + handleChange: PrefInputElement.prototype.handleChange, |
| /** |
| * Update the associated pref when when the user selects an item. |
| @@ -449,8 +463,62 @@ cr.define('options', function() { |
| if (this.onchange) |
| this.onchange(event); |
| }, |
| + |
| + /** |
| + * See |updateDisabledState| above. |
| + */ |
| + setDisabled: PrefInputElement.prototype.setDisabled, |
| + |
| + /** |
| + * Custom change handler that is invoked first when the user makes changes |
|
arv (Not doing code reviews)
2015/04/24 14:22:45
Are these comments just copied from PrefInputEleme
Dan Beam
2015/04/24 21:48:29
or [just] @override
Yuki
2015/04/27 09:22:38
Done.
|
| + * to the input element's state. If it returns false, a default handler is |
| + * invoked next that updates the associated pref. If it returns true, the |
| + * default handler is suppressed (i.e., this works like stopPropagation or |
| + * cancelBubble). |
| + * @param {Event} event Input element change event. |
| + */ |
| + customChangeHandler: PrefInputElement.prototype.customChangeHandler, |
| + |
| + /** |
| + * Custom change handler that is invoked first when the preference |
| + * associated with the input element changes. If it returns false, a default |
| + * handler is invoked next that updates the input element. If it returns |
| + * true, the default handler is suppressed. |
| + * @param {Event} event Input element change event. |
| + */ |
| + customPrefChangeHandler: PrefInputElement.prototype.customPrefChangeHandler, |
| }; |
| + /** |
| + * The name of the associated preference. |
| + */ |
| + cr.defineProperty(PrefSelect, 'pref', cr.PropertyKind.ATTR); |
| + |
| + /** |
| + * The data type of the associated preference, only relevant for derived |
| + * classes that support different data types. |
| + */ |
| + cr.defineProperty(PrefSelect, 'dataType', cr.PropertyKind.ATTR); |
| + |
| + /** |
| + * Whether this input element is part of a dialog. If so, changes take effect |
| + * in the settings UI immediately but are only actually committed when the |
| + * user confirms the dialog. If the user cancels the dialog instead, the |
| + * changes are rolled back in the settings UI and never committed. |
| + */ |
| + cr.defineProperty(PrefSelect, 'dialogPref', cr.PropertyKind.BOOL_ATTR); |
| + |
| + /** |
| + * Whether the associated preference is controlled by a source other than the |
| + * user's setting (can be 'policy', 'extension', 'recommended' or unset). |
| + */ |
| + cr.defineProperty(PrefSelect, 'controlledBy', cr.PropertyKind.ATTR); |
| + |
| + /** |
| + * The user metric string. |
| + */ |
| + cr.defineProperty(PrefSelect, 'metric', cr.PropertyKind.ATTR); |
| + |
| ///////////////////////////////////////////////////////////////////////////// |
| // PrefTextField class: |