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