| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <include src="../uber/uber_utils.js"> | 5 cr.define('help', function() { |
| 6 var Page = cr.ui.pageManager.Page; |
| 7 var PageManager = cr.ui.pageManager.PageManager; |
| 6 | 8 |
| 7 cr.define('help', function() { | |
| 8 /** | 9 /** |
| 9 * Encapsulated handling of the help page. | 10 * Encapsulated handling of the About page. Called 'help' internally to avoid |
| 11 * confusion with generic AboutUI (about:memory, about:sandbox, etc.). |
| 10 */ | 12 */ |
| 11 function HelpPage() {} | 13 function HelpPage() { |
| 14 Page.call(this, 'help', loadTimeData.getString('aboutTitle'), |
| 15 'help-page'); |
| 16 } |
| 12 | 17 |
| 13 cr.addSingletonGetter(HelpPage); | 18 cr.addSingletonGetter(HelpPage); |
| 14 | 19 |
| 15 HelpPage.prototype = { | 20 HelpPage.prototype = { |
| 16 __proto__: help.HelpBasePage.prototype, | 21 __proto__: Page.prototype, |
| 17 | 22 |
| 18 /** | 23 /** |
| 19 * True if after update powerwash button should be displayed. | 24 * True if after update powerwash button should be displayed. |
| 20 * @private | 25 * @private |
| 21 */ | 26 */ |
| 22 powerwashAfterUpdate_: false, | 27 powerwashAfterUpdate_: false, |
| 23 | 28 |
| 24 /** | 29 /** |
| 25 * List of the channels names. | 30 * List of the channel names. |
| 26 * @private | 31 * @private |
| 27 */ | 32 */ |
| 28 channelList_: ['dev-channel', 'beta-channel', 'stable-channel'], | 33 channelList_: ['dev-channel', 'beta-channel', 'stable-channel'], |
| 29 | 34 |
| 30 /** | 35 /** |
| 31 * Bubble for error messages and notifications. | |
| 32 * @private | |
| 33 */ | |
| 34 bubble_: null, | |
| 35 | |
| 36 /** | |
| 37 * Name of the channel the device is currently on. | 36 * Name of the channel the device is currently on. |
| 38 * @private | 37 * @private |
| 39 */ | 38 */ |
| 40 currentChannel_: null, | 39 currentChannel_: null, |
| 41 | 40 |
| 42 /** | 41 /** |
| 43 * Name of the channel the device is supposed to be on. | 42 * Name of the channel the device is supposed to be on. |
| 44 * @private | 43 * @private |
| 45 */ | 44 */ |
| 46 targetChannel_: null, | 45 targetChannel_: null, |
| 47 | 46 |
| 48 /** | 47 /** @override */ |
| 49 * Perform initial setup. | 48 initializePage: function() { |
| 50 */ | 49 Page.prototype.initializePage.call(this); |
| 51 initialize: function() { | |
| 52 help.HelpBasePage.prototype.initialize.call(this, 'help-page'); | |
| 53 | |
| 54 var self = this; | |
| 55 | |
| 56 uber.onContentFrameLoaded(); | |
| 57 | |
| 58 // Set the title. | |
| 59 uber.setTitle(loadTimeData.getString('aboutTitle')); | |
| 60 | 50 |
| 61 $('product-license').innerHTML = loadTimeData.getString('productLicense'); | 51 $('product-license').innerHTML = loadTimeData.getString('productLicense'); |
| 62 if (cr.isChromeOS) { | 52 if (cr.isChromeOS) { |
| 63 $('product-os-license').innerHTML = | 53 $('product-os-license').innerHTML = |
| 64 loadTimeData.getString('productOsLicense'); | 54 loadTimeData.getString('productOsLicense'); |
| 65 } | 55 } |
| 66 | 56 |
| 67 var productTOS = $('product-tos'); | 57 var productTOS = $('product-tos'); |
| 68 if (productTOS) | 58 if (productTOS) |
| 69 productTOS.innerHTML = loadTimeData.getString('productTOS'); | 59 productTOS.innerHTML = loadTimeData.getString('productTOS'); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 86 this.maybeSetOnClick_($('relaunch'), function() { | 76 this.maybeSetOnClick_($('relaunch'), function() { |
| 87 chrome.send('relaunchNow'); | 77 chrome.send('relaunchNow'); |
| 88 }); | 78 }); |
| 89 if (cr.isChromeOS) { | 79 if (cr.isChromeOS) { |
| 90 this.maybeSetOnClick_($('relaunch-and-powerwash'), function() { | 80 this.maybeSetOnClick_($('relaunch-and-powerwash'), function() { |
| 91 chrome.send('relaunchAndPowerwash'); | 81 chrome.send('relaunchAndPowerwash'); |
| 92 }); | 82 }); |
| 93 | 83 |
| 94 this.channelTable_ = { | 84 this.channelTable_ = { |
| 95 'stable-channel': { | 85 'stable-channel': { |
| 96 'name': loadTimeData.getString('stable'), | 86 'name': loadTimeData.getString('stable'), |
| 97 'label': loadTimeData.getString('currentChannelStable'), | 87 'label': loadTimeData.getString('currentChannelStable'), |
| 98 }, | 88 }, |
| 99 'beta-channel': { | 89 'beta-channel': { |
| 100 'name': loadTimeData.getString('beta'), | 90 'name': loadTimeData.getString('beta'), |
| 101 'label': loadTimeData.getString('currentChannelBeta') | 91 'label': loadTimeData.getString('currentChannelBeta') |
| 102 }, | 92 }, |
| 103 'dev-channel': { | 93 'dev-channel': { |
| 104 'name': loadTimeData.getString('dev'), | 94 'name': loadTimeData.getString('dev'), |
| 105 'label': loadTimeData.getString('currentChannelDev') | 95 'label': loadTimeData.getString('currentChannelDev') |
| 106 } | 96 } |
| 107 }; | 97 }; |
| 108 } | 98 } |
| 109 | 99 |
| 100 var self = this; |
| 110 var channelChanger = $('channel-changer'); | 101 var channelChanger = $('channel-changer'); |
| 111 if (channelChanger) { | 102 if (channelChanger) { |
| 112 channelChanger.onchange = function(event) { | 103 channelChanger.onchange = function(event) { |
| 113 self.setChannel_(event.target.value, false); | 104 self.setChannel_(event.target.value, false); |
| 114 }; | 105 }; |
| 115 } | 106 } |
| 116 | 107 |
| 117 if (cr.isChromeOS) { | 108 if (cr.isChromeOS) { |
| 118 help.ChannelChangePage.getInstance().initialize(); | 109 // Add event listener for the close button when shown as an overlay. |
| 119 this.registerOverlay(help.ChannelChangePage.getInstance()); | 110 if ($('about-done')) { |
| 111 $('about-done').addEventListener('click', function() { |
| 112 PageManager.closeOverlay(); |
| 113 }); |
| 114 } |
| 120 | 115 |
| 121 cr.ui.overlay.setupOverlay($('overlay-container')); | |
| 122 cr.ui.overlay.globalInitialization(); | |
| 123 $('overlay-container').addEventListener('cancelOverlay', function() { | |
| 124 self.closeOverlay(); | |
| 125 }); | |
| 126 $('change-channel').onclick = function() { | 116 $('change-channel').onclick = function() { |
| 127 self.showOverlay('channel-change-page'); | 117 PageManager.showPageByName('channel-change-page', false); |
| 128 }; | 118 }; |
| 129 | 119 |
| 130 var channelChangeDisallowedError = document.createElement('div'); | 120 var channelChangeDisallowedError = document.createElement('div'); |
| 131 channelChangeDisallowedError.className = 'channel-change-error-bubble'; | 121 channelChangeDisallowedError.className = 'channel-change-error-bubble'; |
| 132 | 122 |
| 133 var channelChangeDisallowedIcon = document.createElement('div'); | 123 var channelChangeDisallowedIcon = document.createElement('div'); |
| 134 channelChangeDisallowedIcon.classList.add('help-page-icon-large'); | 124 channelChangeDisallowedIcon.classList.add('help-page-icon-large'); |
| 135 channelChangeDisallowedIcon.classList.add('channel-change-error-icon'); | 125 channelChangeDisallowedIcon.classList.add('channel-change-error-icon'); |
| 136 channelChangeDisallowedError.appendChild(channelChangeDisallowedIcon); | 126 channelChangeDisallowedError.appendChild(channelChangeDisallowedIcon); |
| 137 | 127 |
| 138 var channelChangeDisallowedText = document.createElement('div'); | 128 var channelChangeDisallowedText = document.createElement('div'); |
| 139 channelChangeDisallowedText.className = 'channel-change-error-text'; | 129 channelChangeDisallowedText.className = 'channel-change-error-text'; |
| 140 channelChangeDisallowedText.textContent = | 130 channelChangeDisallowedText.textContent = |
| 141 loadTimeData.getString('channelChangeDisallowedMessage'); | 131 loadTimeData.getString('channelChangeDisallowedMessage'); |
| 142 channelChangeDisallowedError.appendChild(channelChangeDisallowedText); | 132 channelChangeDisallowedError.appendChild(channelChangeDisallowedText); |
| 143 | 133 |
| 144 $('channel-change-disallowed-icon').onclick = function() { | 134 $('channel-change-disallowed-icon').onclick = function() { |
| 145 self.showBubble_(channelChangeDisallowedError, | 135 PageManager.showBubble(channelChangeDisallowedError, |
| 146 $('help-container'), | 136 $('channel-change-disallowed-icon'), |
| 147 $('channel-change-disallowed-icon'), | 137 $('help-container'), |
| 148 cr.ui.ArrowLocation.TOP_END); | 138 cr.ui.ArrowLocation.TOP_END); |
| 149 }; | 139 }; |
| 150 } | 140 } |
| 151 | 141 |
| 152 cr.ui.FocusManager.disableMouseFocusOnButtons(); | |
| 153 help.HelpFocusManager.getInstance().initialize(); | |
| 154 | |
| 155 // Attempt to update. | 142 // Attempt to update. |
| 156 chrome.send('onPageLoaded'); | 143 chrome.send('onPageLoaded'); |
| 157 }, | 144 }, |
| 158 | 145 |
| 159 /** | 146 /** |
| 160 * Shows the bubble. | |
| 161 * @param {HTMLDivElement} content The content of the bubble. | |
| 162 * @param {HTMLElement} target The element at which the bubble points. | |
| 163 * @param {HTMLElement} domSibling The element after which the bubble is | |
| 164 * added to the DOM. | |
| 165 * @param {cr.ui.ArrowLocation} location The arrow location. | |
| 166 * @private | |
| 167 */ | |
| 168 showBubble_: function(content, domSibling, target, location) { | |
| 169 if (!cr.isChromeOS) | |
| 170 return; | |
| 171 this.hideBubble_(); | |
| 172 var bubble = new cr.ui.AutoCloseBubble; | |
| 173 bubble.anchorNode = target; | |
| 174 bubble.domSibling = domSibling; | |
| 175 bubble.arrowLocation = location; | |
| 176 bubble.content = content; | |
| 177 bubble.show(); | |
| 178 this.bubble_ = bubble; | |
| 179 }, | |
| 180 | |
| 181 /** | |
| 182 * Hides the bubble. | |
| 183 * @private | |
| 184 */ | |
| 185 hideBubble_: function() { | |
| 186 if (!cr.isChromeOS) | |
| 187 return; | |
| 188 if (this.bubble_) | |
| 189 this.bubble_.hide(); | |
| 190 }, | |
| 191 | |
| 192 /** | |
| 193 * Toggles the visible state of the 'More Info' section. | 147 * Toggles the visible state of the 'More Info' section. |
| 194 * @private | 148 * @private |
| 195 */ | 149 */ |
| 196 toggleMoreInfo_: function() { | 150 toggleMoreInfo_: function() { |
| 197 var moreInfo = $('more-info-container'); | 151 var moreInfo = $('more-info-container'); |
| 198 var visible = moreInfo.className == 'visible'; | 152 var visible = moreInfo.className == 'visible'; |
| 199 moreInfo.className = visible ? '' : 'visible'; | 153 moreInfo.className = visible ? '' : 'visible'; |
| 200 moreInfo.style.height = visible ? '' : moreInfo.scrollHeight + 'px'; | 154 moreInfo.style.height = visible ? '' : moreInfo.scrollHeight + 'px'; |
| 201 moreInfo.addEventListener('webkitTransitionEnd', function(event) { | 155 moreInfo.addEventListener('webkitTransitionEnd', function(event) { |
| 202 $('more-info-expander').textContent = visible ? | 156 $('more-info-expander').textContent = visible ? |
| 203 loadTimeData.getString('showMoreInfo') : | 157 loadTimeData.getString('showMoreInfo') : |
| 204 loadTimeData.getString('hideMoreInfo'); | 158 loadTimeData.getString('hideMoreInfo'); |
| 205 }); | 159 }); |
| 206 }, | 160 }, |
| 207 | 161 |
| 208 /** | 162 /** |
| 209 * Assigns |method| to the onclick property of |el| if |el| exists. | 163 * Assigns |method| to the onclick property of |el| if |el| exists. |
| 164 * @param {HTMLElement} el The element on which to set the click handler. |
| 165 * @param {function} method The click handler. |
| 210 * @private | 166 * @private |
| 211 */ | 167 */ |
| 212 maybeSetOnClick_: function(el, method) { | 168 maybeSetOnClick_: function(el, method) { |
| 213 if (el) | 169 if (el) |
| 214 el.onclick = method; | 170 el.onclick = method; |
| 215 }, | 171 }, |
| 216 | 172 |
| 217 /** | 173 /** |
| 218 * @private | 174 * @param {string} state The state of the update. |
| 175 * private |
| 219 */ | 176 */ |
| 220 setUpdateImage_: function(state) { | 177 setUpdateImage_: function(state) { |
| 221 $('update-status-icon').className = 'help-page-icon ' + state; | 178 $('update-status-icon').className = 'help-page-icon ' + state; |
| 222 }, | 179 }, |
| 223 | 180 |
| 224 /** | 181 /** |
| 225 * @return {boolean} True, if new channel switcher UI is used, | 182 * @return {boolean} True, if new channel switcher UI is used, |
| 226 * false otherwise. | 183 * false otherwise. |
| 227 * @private | 184 * @private |
| 228 */ | 185 */ |
| 229 isNewChannelSwitcherUI_: function() { | 186 isNewChannelSwitcherUI_: function() { |
| 230 return !loadTimeData.valueExists('disableNewChannelSwitcherUI'); | 187 return !loadTimeData.valueExists('disableNewChannelSwitcherUI'); |
| 231 }, | 188 }, |
| 232 | 189 |
| 233 /** | 190 /** |
| 234 * @return {boolean} True if target and current channels are not | 191 * @return {boolean} True if target and current channels are not null and |
| 235 * null and not equals | 192 * not equal. |
| 236 * @private | 193 * @private |
| 237 */ | 194 */ |
| 238 channelsDiffer_: function() { | 195 channelsDiffer_: function() { |
| 239 var current = this.currentChannel_; | 196 var current = this.currentChannel_; |
| 240 var target = this.targetChannel_; | 197 var target = this.targetChannel_; |
| 241 return (current != null && target != null && current != target); | 198 return (current != null && target != null && current != target); |
| 242 }, | 199 }, |
| 243 | 200 |
| 244 /** | 201 /** |
| 202 * @param {string} status The status of the update. |
| 203 * @param {string} message Failure message to display. |
| 245 * @private | 204 * @private |
| 246 */ | 205 */ |
| 247 setUpdateStatus_: function(status, message) { | 206 setUpdateStatus_: function(status, message) { |
| 248 if (cr.isMac && | 207 if (cr.isMac && |
| 249 $('update-status-message') && | 208 $('update-status-message') && |
| 250 $('update-status-message').hidden) { | 209 $('update-status-message').hidden) { |
| 251 // Chrome has reached the end of the line on this system. The | 210 // Chrome has reached the end of the line on this system. The |
| 252 // update-obsolete-system message is displayed. No other auto-update | 211 // update-obsolete-system message is displayed. No other auto-update |
| 253 // status should be displayed. | 212 // status should be displayed. |
| 254 return; | 213 return; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 container.hidden = status == 'disabled'; | 263 container.hidden = status == 'disabled'; |
| 305 $('relaunch').hidden = | 264 $('relaunch').hidden = |
| 306 (status != 'nearly_updated') || !relaunchAndPowerwashHidden; | 265 (status != 'nearly_updated') || !relaunchAndPowerwashHidden; |
| 307 | 266 |
| 308 if (!cr.isMac) | 267 if (!cr.isMac) |
| 309 $('update-percentage').hidden = status != 'updating'; | 268 $('update-percentage').hidden = status != 'updating'; |
| 310 } | 269 } |
| 311 }, | 270 }, |
| 312 | 271 |
| 313 /** | 272 /** |
| 273 * @param {number} progress The percent completion. |
| 314 * @private | 274 * @private |
| 315 */ | 275 */ |
| 316 setProgress_: function(progress) { | 276 setProgress_: function(progress) { |
| 317 $('update-percentage').innerHTML = progress + '%'; | 277 $('update-percentage').innerHTML = progress + '%'; |
| 318 }, | 278 }, |
| 319 | 279 |
| 320 /** | 280 /** |
| 281 * @param {string} message The allowed connection types message. |
| 321 * @private | 282 * @private |
| 322 */ | 283 */ |
| 323 setAllowedConnectionTypesMsg_: function(message) { | 284 setAllowedConnectionTypesMsg_: function(message) { |
| 324 $('allowed-connection-types-message').innerText = message; | 285 $('allowed-connection-types-message').innerText = message; |
| 325 }, | 286 }, |
| 326 | 287 |
| 327 /** | 288 /** |
| 289 * @param {boolean} visible Whether to show the message. |
| 328 * @private | 290 * @private |
| 329 */ | 291 */ |
| 330 showAllowedConnectionTypesMsg_: function(visible) { | 292 showAllowedConnectionTypesMsg_: function(visible) { |
| 331 $('allowed-connection-types-message').hidden = !visible; | 293 $('allowed-connection-types-message').hidden = !visible; |
| 332 }, | 294 }, |
| 333 | 295 |
| 334 /** | 296 /** |
| 297 * @param {string} state The promote state to set. |
| 335 * @private | 298 * @private |
| 336 */ | 299 */ |
| 337 setPromotionState_: function(state) { | 300 setPromotionState_: function(state) { |
| 338 if (state == 'hidden') { | 301 if (state == 'hidden') { |
| 339 $('promote').hidden = true; | 302 $('promote').hidden = true; |
| 340 } else if (state == 'enabled') { | 303 } else if (state == 'enabled') { |
| 341 $('promote').disabled = false; | 304 $('promote').disabled = false; |
| 342 $('promote').hidden = false; | 305 $('promote').hidden = false; |
| 343 } else if (state == 'disabled') { | 306 } else if (state == 'disabled') { |
| 344 $('promote').disabled = true; | 307 $('promote').disabled = true; |
| 345 $('promote').hidden = false; | 308 $('promote').hidden = false; |
| 346 } | 309 } |
| 347 }, | 310 }, |
| 348 | 311 |
| 349 /** | 312 /** |
| 313 * @param {boolean} obsolete Whether the system is obsolete. |
| 350 * @private | 314 * @private |
| 351 */ | 315 */ |
| 352 setObsoleteSystem_: function(obsolete) { | 316 setObsoleteSystem_: function(obsolete) { |
| 353 if (cr.isMac && $('update-obsolete-system-container')) { | 317 if (cr.isMac && $('update-obsolete-system-container')) { |
| 354 $('update-obsolete-system-container').hidden = !obsolete; | 318 $('update-obsolete-system-container').hidden = !obsolete; |
| 355 } | 319 } |
| 356 }, | 320 }, |
| 357 | 321 |
| 358 /** | 322 /** |
| 323 * @param {boolean} endOfTheLine Whether the train has rolled into |
| 324 * the station. |
| 359 * @private | 325 * @private |
| 360 */ | 326 */ |
| 361 setObsoleteSystemEndOfTheLine_: function(endOfTheLine) { | 327 setObsoleteSystemEndOfTheLine_: function(endOfTheLine) { |
| 362 if (cr.isMac && | 328 if (cr.isMac && |
| 363 $('update-obsolete-system-container') && | 329 $('update-obsolete-system-container') && |
| 364 !$('update-obsolete-system-container').hidden && | 330 !$('update-obsolete-system-container').hidden && |
| 365 $('update-status-message')) { | 331 $('update-status-message')) { |
| 366 $('update-status-message').hidden = endOfTheLine; | 332 $('update-status-message').hidden = endOfTheLine; |
| 367 if (endOfTheLine) { | 333 if (endOfTheLine) { |
| 368 this.setUpdateImage_('failed'); | 334 this.setUpdateImage_('failed'); |
| 369 } | 335 } |
| 370 } | 336 } |
| 371 }, | 337 }, |
| 372 | 338 |
| 373 /** | 339 /** |
| 340 * @param {string} version Version of Chrome OS. |
| 374 * @private | 341 * @private |
| 375 */ | 342 */ |
| 376 setOSVersion_: function(version) { | 343 setOSVersion_: function(version) { |
| 377 if (!cr.isChromeOS) | 344 if (!cr.isChromeOS) |
| 378 console.error('OS version unsupported on non-CrOS'); | 345 console.error('OS version unsupported on non-CrOS'); |
| 379 | 346 |
| 380 $('os-version').parentNode.hidden = (version == ''); | 347 $('os-version').parentNode.hidden = (version == ''); |
| 381 $('os-version').textContent = version; | 348 $('os-version').textContent = version; |
| 382 }, | 349 }, |
| 383 | 350 |
| 384 /** | 351 /** |
| 352 * @param {string} firmware Firmware on Chrome OS. |
| 385 * @private | 353 * @private |
| 386 */ | 354 */ |
| 387 setOSFirmware_: function(firmware) { | 355 setOSFirmware_: function(firmware) { |
| 388 if (!cr.isChromeOS) | 356 if (!cr.isChromeOS) |
| 389 console.error('OS firmware unsupported on non-CrOS'); | 357 console.error('OS firmware unsupported on non-CrOS'); |
| 390 | 358 |
| 391 $('firmware').parentNode.hidden = (firmware == ''); | 359 $('firmware').parentNode.hidden = (firmware == ''); |
| 392 $('firmware').textContent = firmware; | 360 $('firmware').textContent = firmware; |
| 393 }, | 361 }, |
| 394 | 362 |
| 395 /** | 363 /** |
| 396 * Updates name of the current channel, i.e. the name of the | 364 * Updates name of the current channel, i.e. the name of the |
| 397 * channel the device is currently on. | 365 * channel the device is currently on. |
| 398 * @param {string} channel The name of the current channel | 366 * @param {string} channel The name of the current channel. |
| 399 * @private | 367 * @private |
| 400 */ | 368 */ |
| 401 updateCurrentChannel_: function(channel) { | 369 updateCurrentChannel_: function(channel) { |
| 402 if (this.channelList_.indexOf(channel) < 0) | 370 if (this.channelList_.indexOf(channel) < 0) |
| 403 return; | 371 return; |
| 404 $('current-channel').textContent = loadTimeData.getStringF( | 372 $('current-channel').textContent = loadTimeData.getStringF( |
| 405 'currentChannel', this.channelTable_[channel].label); | 373 'currentChannel', this.channelTable_[channel].label); |
| 406 this.currentChannel_ = channel; | 374 this.currentChannel_ = channel; |
| 407 help.ChannelChangePage.updateCurrentChannel(channel); | 375 help.ChannelChangePage.updateCurrentChannel(channel); |
| 408 }, | 376 }, |
| 409 | 377 |
| 410 /** | 378 /** |
| 411 * |enabled| is true if the release channel can be enabled. | 379 * @param {boolean} enabled True if the release channel can be enabled. |
| 412 * @private | 380 * @private |
| 413 */ | 381 */ |
| 414 updateEnableReleaseChannel_: function(enabled) { | 382 updateEnableReleaseChannel_: function(enabled) { |
| 415 this.updateChannelChangerContainerVisibility_(enabled); | 383 this.updateChannelChangerContainerVisibility_(enabled); |
| 416 $('change-channel').disabled = !enabled; | 384 $('change-channel').disabled = !enabled; |
| 417 $('channel-change-disallowed-icon').hidden = enabled; | 385 $('channel-change-disallowed-icon').hidden = enabled; |
| 418 }, | 386 }, |
| 419 | 387 |
| 420 /** | 388 /** |
| 421 * Sets the device target channel. | 389 * Sets the device target channel. |
| 422 * @param {string} channel The name of the target channel | 390 * @param {string} channel The name of the target channel. |
| 423 * @param {boolean} isPowerwashAllowed True iff powerwash is allowed | 391 * @param {boolean} isPowerwashAllowed True iff powerwash is allowed. |
| 424 * @private | 392 * @private |
| 425 */ | 393 */ |
| 426 setChannel_: function(channel, isPowerwashAllowed) { | 394 setChannel_: function(channel, isPowerwashAllowed) { |
| 427 this.powerwashAfterUpdate_ = isPowerwashAllowed; | 395 this.powerwashAfterUpdate_ = isPowerwashAllowed; |
| 428 this.targetChannel_ = channel; | 396 this.targetChannel_ = channel; |
| 429 chrome.send('setChannel', [channel, isPowerwashAllowed]); | 397 chrome.send('setChannel', [channel, isPowerwashAllowed]); |
| 430 $('channel-change-confirmation').hidden = false; | 398 $('channel-change-confirmation').hidden = false; |
| 431 $('channel-change-confirmation').textContent = loadTimeData.getStringF( | 399 $('channel-change-confirmation').textContent = loadTimeData.getStringF( |
| 432 'channel-changed', this.channelTable_[channel].name); | 400 'channel-changed', this.channelTable_[channel].name); |
| 433 }, | 401 }, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 }; | 470 }; |
| 503 | 471 |
| 504 HelpPage.setOSVersion = function(version) { | 472 HelpPage.setOSVersion = function(version) { |
| 505 HelpPage.getInstance().setOSVersion_(version); | 473 HelpPage.getInstance().setOSVersion_(version); |
| 506 }; | 474 }; |
| 507 | 475 |
| 508 HelpPage.setOSFirmware = function(firmware) { | 476 HelpPage.setOSFirmware = function(firmware) { |
| 509 HelpPage.getInstance().setOSFirmware_(firmware); | 477 HelpPage.getInstance().setOSFirmware_(firmware); |
| 510 }; | 478 }; |
| 511 | 479 |
| 512 HelpPage.showOverlay = function(name) { | |
| 513 HelpPage.getInstance().showOverlay(name); | |
| 514 }; | |
| 515 | |
| 516 HelpPage.cancelOverlay = function() { | |
| 517 HelpPage.getInstance().closeOverlay(); | |
| 518 }; | |
| 519 | |
| 520 HelpPage.getTopmostVisiblePage = function() { | |
| 521 return HelpPage.getInstance().getTopmostVisiblePage(); | |
| 522 }; | |
| 523 | |
| 524 HelpPage.updateIsEnterpriseManaged = function(isEnterpriseManaged) { | 480 HelpPage.updateIsEnterpriseManaged = function(isEnterpriseManaged) { |
| 525 if (!cr.isChromeOS) | 481 if (!cr.isChromeOS) |
| 526 return; | 482 return; |
| 527 help.ChannelChangePage.updateIsEnterpriseManaged(isEnterpriseManaged); | 483 help.ChannelChangePage.updateIsEnterpriseManaged(isEnterpriseManaged); |
| 528 }; | 484 }; |
| 529 | 485 |
| 530 HelpPage.updateCurrentChannel = function(channel) { | 486 HelpPage.updateCurrentChannel = function(channel) { |
| 531 if (!cr.isChromeOS) | 487 if (!cr.isChromeOS) |
| 532 return; | 488 return; |
| 533 HelpPage.getInstance().updateCurrentChannel_(channel); | 489 HelpPage.getInstance().updateCurrentChannel_(channel); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 553 | 509 |
| 554 HelpPage.updateChannelChangePageContainerVisibility = function() { | 510 HelpPage.updateChannelChangePageContainerVisibility = function() { |
| 555 HelpPage.getInstance().updateChannelChangePageContainerVisibility_(); | 511 HelpPage.getInstance().updateChannelChangePageContainerVisibility_(); |
| 556 }; | 512 }; |
| 557 | 513 |
| 558 // Export | 514 // Export |
| 559 return { | 515 return { |
| 560 HelpPage: HelpPage | 516 HelpPage: HelpPage |
| 561 }; | 517 }; |
| 562 }); | 518 }); |
| 563 | |
| 564 /** | |
| 565 * onload listener to initialize the HelpPage. | |
| 566 */ | |
| 567 window.onload = function() { | |
| 568 help.HelpPage.getInstance().initialize(); | |
| 569 }; | |
| OLD | NEW |