| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 * Alias for document.getElementById. | 6 * Alias for document.getElementById. |
| 7 * | 7 * |
| 8 * @param {string} id | 8 * @param {string} id |
| 9 * @return {Element} | 9 * @return {Element} |
| 10 */ | 10 */ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * User preferences. | 24 * User preferences. |
| 25 * | 25 * |
| 26 * @type {SwitchAccessPrefs} | 26 * @type {SwitchAccessPrefs} |
| 27 */ | 27 */ |
| 28 this.switchAccessPrefs_ = background.switchAccess.switchAccessPrefs; | 28 this.switchAccessPrefs_ = background.switchAccess.switchAccessPrefs; |
| 29 | 29 |
| 30 this.init_(); | 30 this.init_(); |
| 31 document.addEventListener('change', this.handleInputChange_.bind(this)); | 31 document.addEventListener('change', this.handleInputChange_.bind(this)); |
| 32 background.document.addEventListener( | 32 background.document.addEventListener( |
| 33 'prefsUpdate', this.handlePrefsUpdate_.bind(this)); | 33 'prefsUpdate', this.handlePrefsUpdate_.bind(this)); |
| 34 }; | 34 } |
| 35 | 35 |
| 36 SwitchAccessOptions.prototype = { | 36 SwitchAccessOptions.prototype = { |
| 37 /** | 37 /** |
| 38 * Initialize the options page by setting all elements representing a user | 38 * Initialize the options page by setting all elements representing a user |
| 39 * preference to show the correct value. | 39 * preference to show the correct value. |
| 40 * | 40 * |
| 41 * @private | 41 * @private |
| 42 */ | 42 */ |
| 43 init_: function() { | 43 init_: function() { |
| 44 $('enableAutoScan').checked = | 44 $('enableAutoScan').checked = |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 $(key).value = updatedPrefs[key] / 1000; | 103 $(key).value = updatedPrefs[key] / 1000; |
| 104 break; | 104 break; |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 document.addEventListener('DOMContentLoaded', function() { | 110 document.addEventListener('DOMContentLoaded', function() { |
| 111 new SwitchAccessOptions(); | 111 new SwitchAccessOptions(); |
| 112 }); | 112 }); |
| OLD | NEW |