| OLD | NEW |
| 1 // Copyright 2014 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 /** | 5 /** |
| 6 * @fileoverview Display manager for WebUI OOBE and login. | 6 * @fileoverview Display manager for WebUI OOBE and login. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 // TODO(xiyuan): Find a better to share those constants. | 9 // TODO(xiyuan): Find a better to share those constants. |
| 10 /** @const */ var SCREEN_OOBE_NETWORK = 'connect'; | 10 /** @const */ var SCREEN_OOBE_NETWORK = 'connect'; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 showVersion: function(show) { | 206 showVersion: function(show) { |
| 207 $('version-labels').hidden = !show; | 207 $('version-labels').hidden = !show; |
| 208 this.allowToggleVersion_ = !show; | 208 this.allowToggleVersion_ = !show; |
| 209 }, | 209 }, |
| 210 | 210 |
| 211 /** | 211 /** |
| 212 * Handle accelerators. | 212 * Handle accelerators. |
| 213 * @param {string} name Accelerator name. | 213 * @param {string} name Accelerator name. |
| 214 */ | 214 */ |
| 215 handleAccelerator: function(name) { | 215 handleAccelerator: function(name) { |
| 216 var currentStepId = this.screens_[this.currentStep_]; |
| 216 if (name == ACCELERATOR_CANCEL) { | 217 if (name == ACCELERATOR_CANCEL) { |
| 217 if (this.currentScreen.cancel) { | 218 if (this.currentScreen.cancel) { |
| 218 this.currentScreen.cancel(); | 219 this.currentScreen.cancel(); |
| 219 } | 220 } |
| 220 } else if (name == ACCELERATOR_ENROLLMENT) { | 221 } else if (name == ACCELERATOR_ENROLLMENT) { |
| 221 var currentStepId = this.screens_[this.currentStep_]; | |
| 222 if (currentStepId == SCREEN_GAIA_SIGNIN || | 222 if (currentStepId == SCREEN_GAIA_SIGNIN || |
| 223 currentStepId == SCREEN_ACCOUNT_PICKER) { | 223 currentStepId == SCREEN_ACCOUNT_PICKER) { |
| 224 chrome.send('toggleEnrollmentScreen'); | 224 chrome.send('toggleEnrollmentScreen'); |
| 225 } else if (currentStepId == SCREEN_OOBE_NETWORK || | 225 } else if (currentStepId == SCREEN_OOBE_NETWORK || |
| 226 currentStepId == SCREEN_OOBE_EULA) { | 226 currentStepId == SCREEN_OOBE_EULA) { |
| 227 // In this case update check will be skipped and OOBE will | 227 // In this case update check will be skipped and OOBE will |
| 228 // proceed straight to enrollment screen when EULA is accepted. | 228 // proceed straight to enrollment screen when EULA is accepted. |
| 229 chrome.send('skipUpdateEnrollAfterEula'); | 229 chrome.send('skipUpdateEnrollAfterEula'); |
| 230 } else if (currentStepId == SCREEN_OOBE_ENROLLMENT) { | 230 } else if (currentStepId == SCREEN_OOBE_ENROLLMENT) { |
| 231 // This accelerator is also used to manually cancel auto-enrollment. | 231 // This accelerator is also used to manually cancel auto-enrollment. |
| 232 if (this.currentScreen.cancelAutoEnrollment) | 232 if (this.currentScreen.cancelAutoEnrollment) |
| 233 this.currentScreen.cancelAutoEnrollment(); | 233 this.currentScreen.cancelAutoEnrollment(); |
| 234 } | 234 } |
| 235 } else if (name == ACCELERATOR_KIOSK_ENABLE) { | 235 } else if (name == ACCELERATOR_KIOSK_ENABLE) { |
| 236 var currentStepId = this.screens_[this.currentStep_]; | |
| 237 if (currentStepId == SCREEN_GAIA_SIGNIN || | 236 if (currentStepId == SCREEN_GAIA_SIGNIN || |
| 238 currentStepId == SCREEN_ACCOUNT_PICKER) { | 237 currentStepId == SCREEN_ACCOUNT_PICKER) { |
| 239 chrome.send('toggleKioskEnableScreen'); | 238 chrome.send('toggleKioskEnableScreen'); |
| 240 } | 239 } |
| 241 } else if (name == ACCELERATOR_VERSION) { | 240 } else if (name == ACCELERATOR_VERSION) { |
| 242 if (this.allowToggleVersion_) | 241 if (this.allowToggleVersion_) |
| 243 $('version-labels').hidden = !$('version-labels').hidden; | 242 $('version-labels').hidden = !$('version-labels').hidden; |
| 244 } else if (name == ACCELERATOR_RESET) { | 243 } else if (name == ACCELERATOR_RESET) { |
| 245 var currentStepId = this.screens_[this.currentStep_]; | |
| 246 if (currentStepId == SCREEN_GAIA_SIGNIN || | 244 if (currentStepId == SCREEN_GAIA_SIGNIN || |
| 247 currentStepId == SCREEN_ACCOUNT_PICKER) { | 245 currentStepId == SCREEN_ACCOUNT_PICKER) { |
| 248 chrome.send('toggleResetScreen'); | 246 chrome.send('toggleResetScreen'); |
| 249 } | 247 } |
| 250 } else if (name == ACCELERATOR_DEVICE_REQUISITION) { | 248 } else if (name == ACCELERATOR_DEVICE_REQUISITION) { |
| 251 if (this.isOobeUI()) | 249 if (this.isOobeUI()) |
| 252 this.showDeviceRequisitionPrompt_(); | 250 this.showDeviceRequisitionPrompt_(); |
| 253 } else if (name == ACCELERATOR_DEVICE_REQUISITION_REMORA) { | 251 } else if (name == ACCELERATOR_DEVICE_REQUISITION_REMORA) { |
| 254 if (this.isOobeUI()) | 252 if (this.isOobeUI()) |
| 255 this.showDeviceRequisitionRemoraPrompt_(); | 253 this.showDeviceRequisitionRemoraPrompt_(); |
| 256 } else if (name == ACCELERATOR_APP_LAUNCH_BAILOUT) { | 254 } else if (name == ACCELERATOR_APP_LAUNCH_BAILOUT) { |
| 257 var currentStepId = this.screens_[this.currentStep_]; | |
| 258 if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) | 255 if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) |
| 259 chrome.send('cancelAppLaunch'); | 256 chrome.send('cancelAppLaunch'); |
| 260 } else if (name == ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG) { | 257 } else if (name == ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG) { |
| 261 var currentStepId = this.screens_[this.currentStep_]; | |
| 262 if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) | 258 if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) |
| 263 chrome.send('networkConfigRequest'); | 259 chrome.send('networkConfigRequest'); |
| 264 } | 260 } |
| 265 | 261 |
| 266 if (!this.forceKeyboardFlow_) | 262 if (!this.forceKeyboardFlow_) |
| 267 return; | 263 return; |
| 268 | 264 |
| 269 // Handle special accelerators for keyboard enhanced navigation flow. | 265 // Handle special accelerators for keyboard enhanced navigation flow. |
| 270 if (name == ACCELERATOR_FOCUS_PREV) | 266 if (name == ACCELERATOR_FOCUS_PREV) |
| 271 keyboard.raiseKeyFocusPrevious(document.activeElement); | 267 keyboard.raiseKeyFocusPrevious(document.activeElement); |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 */ | 882 */ |
| 887 DisplayManager.refocusCurrentPod = function() { | 883 DisplayManager.refocusCurrentPod = function() { |
| 888 $('pod-row').refocusCurrentPod(); | 884 $('pod-row').refocusCurrentPod(); |
| 889 }; | 885 }; |
| 890 | 886 |
| 891 // Export | 887 // Export |
| 892 return { | 888 return { |
| 893 DisplayManager: DisplayManager | 889 DisplayManager: DisplayManager |
| 894 }; | 890 }; |
| 895 }); | 891 }); |
| OLD | NEW |