| 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 28 matching lines...) Expand all Loading... |
| 39 /** | 39 /** |
| 40 * List of the channels names, from the least stable to the most stable. | 40 * List of the channels names, from the least stable to the most stable. |
| 41 * @private | 41 * @private |
| 42 */ | 42 */ |
| 43 channelList_: ['dev-channel', 'beta-channel', 'stable-channel'], | 43 channelList_: ['dev-channel', 'beta-channel', 'stable-channel'], |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * List of the possible ui states. | 46 * List of the possible ui states. |
| 47 * @private | 47 * @private |
| 48 */ | 48 */ |
| 49 uiClassTable_: ['selected-channel-requires-powerwash', | 49 uiClassTable_: [ |
| 50 'selected-channel-requires-delayed-update', | 50 'selected-channel-requires-powerwash', |
| 51 'selected-channel-good', | 51 'selected-channel-requires-delayed-update', 'selected-channel-good', |
| 52 'selected-channel-unstable'], | 52 'selected-channel-unstable' |
| 53 ], |
| 53 | 54 |
| 54 /** override */ | 55 /** override */ |
| 55 initializePage: function() { | 56 initializePage: function() { |
| 56 Page.prototype.initializePage.call(this); | 57 Page.prototype.initializePage.call(this); |
| 57 | 58 |
| 58 $('channel-change-page-cancel-button').onclick = | 59 $('channel-change-page-cancel-button').onclick = |
| 59 PageManager.closeOverlay.bind(PageManager); | 60 PageManager.closeOverlay.bind(PageManager); |
| 60 | 61 |
| 61 var self = this; | 62 var self = this; |
| 62 var options = this.getAllChannelOptions_(); | 63 var options = this.getAllChannelOptions_(); |
| 63 for (var i = 0; i < options.length; i++) { | 64 for (var i = 0; i < options.length; i++) { |
| 64 var option = options[i]; | 65 var option = options[i]; |
| 65 option.onclick = function() { | 66 option.onclick = function() { |
| 66 self.updateUI_(this.value); | 67 self.updateUI_(this.value); |
| 67 }; | 68 }; |
| 68 } | 69 } |
| 69 | 70 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 this.isEnterpriseManaged_ = isEnterpriseManaged; | 198 this.isEnterpriseManaged_ = isEnterpriseManaged; |
| 198 }, | 199 }, |
| 199 | 200 |
| 200 /** | 201 /** |
| 201 * Updates name of the current channel, i.e. the name of the | 202 * Updates name of the current channel, i.e. the name of the |
| 202 * channel the device is currently on. | 203 * channel the device is currently on. |
| 203 * @param {string} channel The name of the current channel | 204 * @param {string} channel The name of the current channel |
| 204 * @private | 205 * @private |
| 205 */ | 206 */ |
| 206 updateCurrentChannel_: function(channel) { | 207 updateCurrentChannel_: function(channel) { |
| 207 if (this.channelList_.indexOf(channel) < 0) | 208 if (this.channelList_.indexOf(channel) < 0) |
| 208 return; | 209 return; |
| 209 this.currentChannel_ = channel; | 210 this.currentChannel_ = channel; |
| 210 this.selectOption_(channel); | 211 this.selectOption_(channel); |
| 211 }, | 212 }, |
| 212 | 213 |
| 213 /** | 214 /** |
| 214 * Updates name of the target channel, i.e. the name of the | 215 * Updates name of the target channel, i.e. the name of the |
| 215 * channel the device is supposed to be in case of a pending | 216 * channel the device is supposed to be in case of a pending |
| 216 * channel change. | 217 * channel change. |
| 217 * @param {string} channel The name of the target channel | 218 * @param {string} channel The name of the target channel |
| (...skipping 30 matching lines...) Expand all Loading... |
| 248 | 249 |
| 249 ChannelChangePage.updateTargetChannel = function(channel) { | 250 ChannelChangePage.updateTargetChannel = function(channel) { |
| 250 ChannelChangePage.getInstance().updateTargetChannel_(channel); | 251 ChannelChangePage.getInstance().updateTargetChannel_(channel); |
| 251 }; | 252 }; |
| 252 | 253 |
| 253 ChannelChangePage.isPageReady = function() { | 254 ChannelChangePage.isPageReady = function() { |
| 254 return ChannelChangePage.getInstance().isPageReady_(); | 255 return ChannelChangePage.getInstance().isPageReady_(); |
| 255 }; | 256 }; |
| 256 | 257 |
| 257 // Export | 258 // Export |
| 258 return { | 259 return {ChannelChangePage: ChannelChangePage}; |
| 259 ChannelChangePage: ChannelChangePage | |
| 260 }; | |
| 261 }); | 260 }); |
| OLD | NEW |