Chromium Code Reviews| OLD | NEW |
|---|---|
| 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-input` is a single-line text field for user input associated | 7 * `settings-input` is a single-line text field for user input associated |
| 8 * with a pref value. | 8 * with a pref value. |
| 9 * | 9 * |
| 10 * @element cr-settings-input | 10 * @element settings-input |
| 11 */ | 11 */ |
| 12 Polymer({ | 12 Polymer({ |
| 13 is: 'cr-settings-input', | 13 is: 'settings-input', |
| 14 | 14 |
| 15 behaviors: [PolicyControllable], | 15 behaviors: [PolicyControllable], |
| 16 | 16 |
| 17 properties: { | 17 properties: { |
| 18 /** | 18 /** |
| 19 * The preference object to control. | 19 * The preference object to control. |
| 20 * @type {chrome.settingsPrivate.PrefObject|undefined} | 20 * @type {chrome.settingsPrivate.PrefObject|undefined} |
| 21 */ | 21 */ |
| 22 pref: { | 22 pref: { |
| 23 type: Object, | 23 type: Object, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 | 67 |
| 68 /** @override */ | 68 /** @override */ |
| 69 ready: function() { | 69 ready: function() { |
| 70 this.$.events.forward(this.$.input, ['change']); | 70 this.$.events.forward(this.$.input, ['change']); |
| 71 }, | 71 }, |
| 72 | 72 |
| 73 /** | 73 /** |
| 74 * Focuses the 'input' element. | 74 * Focuses the 'input' element. |
| 75 */ | 75 */ |
| 76 focus: function() { | 76 focus: function() { |
| 77 this.$.input.inputElement.focus(); | 77 this.$.input.focus(); |
|
stevenjb
2015/09/29 20:48:45
This is the only non-trivial change. This wasn't a
| |
| 78 }, | 78 }, |
| 79 | 79 |
| 80 /** | 80 /** |
| 81 * Polymer changed observer for |pref|. | 81 * Polymer changed observer for |pref|. |
| 82 * @private | 82 * @private |
| 83 */ | 83 */ |
| 84 prefChanged_: function() { | 84 prefChanged_: function() { |
| 85 if (!this.pref) | 85 if (!this.pref) |
| 86 return; | 86 return; |
| 87 | 87 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 /** | 129 /** |
| 130 * @param {boolean} disabled | 130 * @param {boolean} disabled |
| 131 * @param {?chrome.settingsPrivate.PrefObject} pref | 131 * @param {?chrome.settingsPrivate.PrefObject} pref |
| 132 * @return {boolean} Whether the element should be disabled. | 132 * @return {boolean} Whether the element should be disabled. |
| 133 * @private | 133 * @private |
| 134 */ | 134 */ |
| 135 isDisabled_: function(disabled, pref) { | 135 isDisabled_: function(disabled, pref) { |
| 136 return disabled || this.isPolicyControlled(pref); | 136 return disabled || this.isPolicyControlled(pref); |
| 137 }, | 137 }, |
| 138 }); | 138 }); |
| OLD | NEW |