| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 cr.define('help', function() { | 5 cr.define('help', function() { |
| 6 var Page = cr.ui.pageManager.Page; | 6 var Page = cr.ui.pageManager.Page; |
| 7 var PageManager = cr.ui.pageManager.PageManager; | 7 var PageManager = cr.ui.pageManager.PageManager; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Encapsulated handling of the channel change overlay. | 10 * Encapsulated handling of the channel change overlay. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 var options = this.getAllChannelOptions_(); | 87 var options = this.getAllChannelOptions_(); |
| 88 for (var i = 0; i < options.length; i++) { | 88 for (var i = 0; i < options.length; i++) { |
| 89 var option = options[i]; | 89 var option = options[i]; |
| 90 if (option.checked) | 90 if (option.checked) |
| 91 option.focus(); | 91 option.focus(); |
| 92 } | 92 } |
| 93 }, | 93 }, |
| 94 | 94 |
| 95 /** | 95 /** |
| 96 * Returns the list of all radio buttons responsible for channel selection. | 96 * Returns the list of all radio buttons responsible for channel selection. |
| 97 * @return {Array.<HTMLInputElement>} Array of radio buttons | 97 * @return {NodeList} Array of radio buttons |
| 98 * @private | 98 * @private |
| 99 */ | 99 */ |
| 100 getAllChannelOptions_: function() { | 100 getAllChannelOptions_: function() { |
| 101 return this.pageDiv.querySelectorAll('input[type="radio"]'); | 101 return this.pageDiv.querySelectorAll('input[type="radio"]'); |
| 102 }, | 102 }, |
| 103 | 103 |
| 104 /** | 104 /** |
| 105 * Returns value of the selected option. | 105 * Returns value of the selected option. |
| 106 * @return {string} Selected channel name or null, if neither | 106 * @return {?string} Selected channel name or null, if neither |
| 107 * option is selected. | 107 * option is selected. |
| 108 * @private | 108 * @private |
| 109 */ | 109 */ |
| 110 getSelectedOption_: function() { | 110 getSelectedOption_: function() { |
| 111 var options = this.getAllChannelOptions_(); | 111 var options = this.getAllChannelOptions_(); |
| 112 for (var i = 0; i < options.length; i++) { | 112 for (var i = 0; i < options.length; i++) { |
| 113 var option = options[i]; | 113 var option = options[i]; |
| 114 if (option.checked) | 114 if (option.checked) |
| 115 return option.value; | 115 return option.value; |
| 116 } | 116 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 ChannelChangePage.isPageReady = function() { | 256 ChannelChangePage.isPageReady = function() { |
| 257 return ChannelChangePage.getInstance().isPageReady_(); | 257 return ChannelChangePage.getInstance().isPageReady_(); |
| 258 }; | 258 }; |
| 259 | 259 |
| 260 // Export | 260 // Export |
| 261 return { | 261 return { |
| 262 ChannelChangePage: ChannelChangePage | 262 ChannelChangePage: ChannelChangePage |
| 263 }; | 263 }; |
| 264 }); | 264 }); |
| OLD | NEW |