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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 /** @const */ var DISPLAY_TYPE = { | 79 /** @const */ var DISPLAY_TYPE = { |
80 UNKNOWN: 'unknown', | 80 UNKNOWN: 'unknown', |
81 OOBE: 'oobe', | 81 OOBE: 'oobe', |
82 LOGIN: 'login', | 82 LOGIN: 'login', |
83 LOCK: 'lock', | 83 LOCK: 'lock', |
84 USER_ADDING: 'user-adding', | 84 USER_ADDING: 'user-adding', |
85 APP_LAUNCH_SPLASH: 'app-launch-splash', | 85 APP_LAUNCH_SPLASH: 'app-launch-splash', |
86 DESKTOP_USER_MANAGER: 'login-add-user' | 86 DESKTOP_USER_MANAGER: 'login-add-user' |
87 }; | 87 }; |
88 | 88 |
| 89 /** @const */ var USER_ACTION_ROLLBACK_TOGGLED = 'rollback-toggled'; |
| 90 |
89 cr.define('cr.ui.login', function() { | 91 cr.define('cr.ui.login', function() { |
90 var Bubble = cr.ui.Bubble; | 92 var Bubble = cr.ui.Bubble; |
91 | 93 |
92 /** | 94 /** |
93 * Maximum time in milliseconds to wait for step transition to finish. | 95 * Maximum time in milliseconds to wait for step transition to finish. |
94 * The value is used as the duration for ensureTransitionEndEvent below. | 96 * The value is used as the duration for ensureTransitionEndEvent below. |
95 * It needs to be inline with the step screen transition duration time | 97 * It needs to be inline with the step screen transition duration time |
96 * defined in css file. The current value in css is 200ms. To avoid emulated | 98 * defined in css file. The current value in css is 200ms. To avoid emulated |
97 * webkitTransitionEnd fired before real one, 250ms is used. | 99 * webkitTransitionEnd fired before real one, 250ms is used. |
98 * @const | 100 * @const |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 } else if (name == ACCELERATOR_KIOSK_ENABLE) { | 373 } else if (name == ACCELERATOR_KIOSK_ENABLE) { |
372 if (currentStepId == SCREEN_GAIA_SIGNIN || | 374 if (currentStepId == SCREEN_GAIA_SIGNIN || |
373 currentStepId == SCREEN_ACCOUNT_PICKER) { | 375 currentStepId == SCREEN_ACCOUNT_PICKER) { |
374 chrome.send('toggleKioskEnableScreen'); | 376 chrome.send('toggleKioskEnableScreen'); |
375 } | 377 } |
376 } else if (name == ACCELERATOR_VERSION) { | 378 } else if (name == ACCELERATOR_VERSION) { |
377 if (this.allowToggleVersion_) | 379 if (this.allowToggleVersion_) |
378 $('version-labels').hidden = !$('version-labels').hidden; | 380 $('version-labels').hidden = !$('version-labels').hidden; |
379 } else if (name == ACCELERATOR_RESET) { | 381 } else if (name == ACCELERATOR_RESET) { |
380 if (currentStepId == SCREEN_OOBE_RESET) | 382 if (currentStepId == SCREEN_OOBE_RESET) |
381 chrome.send('toggleRollbackOnResetScreen'); | 383 $('reset').send(login.Screen.CALLBACK_USER_ACTED, |
| 384 USER_ACTION_ROLLBACK_TOGGLED); |
382 else if (RESET_AVAILABLE_SCREEN_GROUP.indexOf(currentStepId) != -1) | 385 else if (RESET_AVAILABLE_SCREEN_GROUP.indexOf(currentStepId) != -1) |
383 chrome.send('toggleResetScreen'); | 386 chrome.send('toggleResetScreen'); |
384 } else if (name == ACCELERATOR_DEVICE_REQUISITION) { | 387 } else if (name == ACCELERATOR_DEVICE_REQUISITION) { |
385 if (this.isOobeUI()) | 388 if (this.isOobeUI()) |
386 this.showDeviceRequisitionPrompt_(); | 389 this.showDeviceRequisitionPrompt_(); |
387 } else if (name == ACCELERATOR_DEVICE_REQUISITION_REMORA) { | 390 } else if (name == ACCELERATOR_DEVICE_REQUISITION_REMORA) { |
388 if (this.isOobeUI()) | 391 if (this.isOobeUI()) |
389 this.showDeviceRequisitionRemoraPrompt_( | 392 this.showDeviceRequisitionRemoraPrompt_( |
390 'deviceRequisitionRemoraPromptText', 'remora'); | 393 'deviceRequisitionRemoraPromptText', 'remora'); |
391 } else if (name == ACCELERATOR_DEVICE_REQUISITION_SHARK) { | 394 } else if (name == ACCELERATOR_DEVICE_REQUISITION_SHARK) { |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 */ | 1069 */ |
1067 DisplayManager.refocusCurrentPod = function() { | 1070 DisplayManager.refocusCurrentPod = function() { |
1068 $('pod-row').refocusCurrentPod(); | 1071 $('pod-row').refocusCurrentPod(); |
1069 }; | 1072 }; |
1070 | 1073 |
1071 // Export | 1074 // Export |
1072 return { | 1075 return { |
1073 DisplayManager: DisplayManager | 1076 DisplayManager: DisplayManager |
1074 }; | 1077 }; |
1075 }); | 1078 }); |
OLD | NEW |