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 27 matching lines...) Expand all Loading... |
38 /** @const */ var ACCELERATOR_TOGGLE_EASY_BOOTSTRAP = 'toggle_easy_bootstrap'; | 38 /** @const */ var ACCELERATOR_TOGGLE_EASY_BOOTSTRAP = 'toggle_easy_bootstrap'; |
39 /** @const */ var ACCELERATOR_ENROLLMENT = 'enrollment'; | 39 /** @const */ var ACCELERATOR_ENROLLMENT = 'enrollment'; |
40 /** @const */ var ACCELERATOR_KIOSK_ENABLE = 'kiosk_enable'; | 40 /** @const */ var ACCELERATOR_KIOSK_ENABLE = 'kiosk_enable'; |
41 /** @const */ var ACCELERATOR_VERSION = 'version'; | 41 /** @const */ var ACCELERATOR_VERSION = 'version'; |
42 /** @const */ var ACCELERATOR_RESET = 'reset'; | 42 /** @const */ var ACCELERATOR_RESET = 'reset'; |
43 /** @const */ var ACCELERATOR_FOCUS_PREV = 'focus_prev'; | 43 /** @const */ var ACCELERATOR_FOCUS_PREV = 'focus_prev'; |
44 /** @const */ var ACCELERATOR_FOCUS_NEXT = 'focus_next'; | 44 /** @const */ var ACCELERATOR_FOCUS_NEXT = 'focus_next'; |
45 /** @const */ var ACCELERATOR_DEVICE_REQUISITION = 'device_requisition'; | 45 /** @const */ var ACCELERATOR_DEVICE_REQUISITION = 'device_requisition'; |
46 /** @const */ var ACCELERATOR_DEVICE_REQUISITION_REMORA = | 46 /** @const */ var ACCELERATOR_DEVICE_REQUISITION_REMORA = |
47 'device_requisition_remora'; | 47 'device_requisition_remora'; |
48 /** @const */ var ACCELERATOR_DEVICE_REQUISITION_SHARK = | |
49 'device_requisition_shark'; | |
50 /** @const */ var ACCELERATOR_APP_LAUNCH_BAILOUT = 'app_launch_bailout'; | 48 /** @const */ var ACCELERATOR_APP_LAUNCH_BAILOUT = 'app_launch_bailout'; |
51 /** @const */ var ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG = | 49 /** @const */ var ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG = |
52 'app_launch_network_config'; | 50 'app_launch_network_config'; |
53 | 51 |
54 /* Signin UI state constants. Used to control header bar UI. */ | 52 /* Signin UI state constants. Used to control header bar UI. */ |
55 /** @const */ var SIGNIN_UI_STATE = { | 53 /** @const */ var SIGNIN_UI_STATE = { |
56 HIDDEN: 0, | 54 HIDDEN: 0, |
57 GAIA_SIGNIN: 1, | 55 GAIA_SIGNIN: 1, |
58 ACCOUNT_PICKER: 2, | 56 ACCOUNT_PICKER: 2, |
59 WRONG_HWID_WARNING: 3, | 57 WRONG_HWID_WARNING: 3, |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 USER_ACTION_ROLLBACK_TOGGLED); | 352 USER_ACTION_ROLLBACK_TOGGLED); |
355 else if (RESET_AVAILABLE_SCREEN_GROUP.indexOf(currentStepId) != -1) | 353 else if (RESET_AVAILABLE_SCREEN_GROUP.indexOf(currentStepId) != -1) |
356 chrome.send('toggleResetScreen'); | 354 chrome.send('toggleResetScreen'); |
357 } else if (name == ACCELERATOR_DEVICE_REQUISITION) { | 355 } else if (name == ACCELERATOR_DEVICE_REQUISITION) { |
358 if (this.isOobeUI()) | 356 if (this.isOobeUI()) |
359 this.showDeviceRequisitionPrompt_(); | 357 this.showDeviceRequisitionPrompt_(); |
360 } else if (name == ACCELERATOR_DEVICE_REQUISITION_REMORA) { | 358 } else if (name == ACCELERATOR_DEVICE_REQUISITION_REMORA) { |
361 if (this.isOobeUI()) | 359 if (this.isOobeUI()) |
362 this.showDeviceRequisitionRemoraPrompt_( | 360 this.showDeviceRequisitionRemoraPrompt_( |
363 'deviceRequisitionRemoraPromptText', 'remora'); | 361 'deviceRequisitionRemoraPromptText', 'remora'); |
364 } else if (name == ACCELERATOR_DEVICE_REQUISITION_SHARK) { | |
365 if (this.isOobeUI()) | |
366 this.showDeviceRequisitionRemoraPrompt_( | |
367 'deviceRequisitionSharkPromptText', 'shark'); | |
368 } else if (name == ACCELERATOR_APP_LAUNCH_BAILOUT) { | 362 } else if (name == ACCELERATOR_APP_LAUNCH_BAILOUT) { |
369 if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) | 363 if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) |
370 chrome.send('cancelAppLaunch'); | 364 chrome.send('cancelAppLaunch'); |
371 } else if (name == ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG) { | 365 } else if (name == ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG) { |
372 if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) | 366 if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) |
373 chrome.send('networkConfigRequest'); | 367 chrome.send('networkConfigRequest'); |
374 } else if (name == ACCELERATOR_TOGGLE_EASY_BOOTSTRAP) { | 368 } else if (name == ACCELERATOR_TOGGLE_EASY_BOOTSTRAP) { |
375 if (currentStepId == SCREEN_GAIA_SIGNIN) | 369 if (currentStepId == SCREEN_GAIA_SIGNIN) |
376 chrome.send('toggleEasyBootstrap'); | 370 chrome.send('toggleEasyBootstrap'); |
377 } | 371 } |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 | 777 |
784 /* | 778 /* |
785 * Updates the device requisition string shown in the requisition prompt. | 779 * Updates the device requisition string shown in the requisition prompt. |
786 * @param {string} requisition The device requisition. | 780 * @param {string} requisition The device requisition. |
787 */ | 781 */ |
788 updateDeviceRequisition: function(requisition) { | 782 updateDeviceRequisition: function(requisition) { |
789 this.deviceRequisition_ = requisition; | 783 this.deviceRequisition_ = requisition; |
790 }, | 784 }, |
791 | 785 |
792 /** | 786 /** |
793 * Shows the special remora/shark device requisition prompt. | 787 * Shows the special remora device requisition prompt. |
794 * @private | 788 * @private |
795 */ | 789 */ |
796 showDeviceRequisitionRemoraPrompt_: function(promptText, requisition) { | 790 showDeviceRequisitionRemoraPrompt_: function(promptText, requisition) { |
797 if (!this.deviceRequisitionRemoraDialog_) { | 791 if (!this.deviceRequisitionRemoraDialog_) { |
798 this.deviceRequisitionRemoraDialog_ = | 792 this.deviceRequisitionRemoraDialog_ = |
799 new cr.ui.dialogs.ConfirmDialog(document.body); | 793 new cr.ui.dialogs.ConfirmDialog(document.body); |
800 this.deviceRequisitionRemoraDialog_.setOkLabel( | 794 this.deviceRequisitionRemoraDialog_.setOkLabel( |
801 loadTimeData.getString('deviceRequisitionRemoraPromptOk')); | 795 loadTimeData.getString('deviceRequisitionRemoraPromptOk')); |
802 this.deviceRequisitionRemoraDialog_.setCancelLabel( | 796 this.deviceRequisitionRemoraDialog_.setCancelLabel( |
803 loadTimeData.getString('deviceRequisitionRemoraPromptCancel')); | 797 loadTimeData.getString('deviceRequisitionRemoraPromptCancel')); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 */ | 1036 */ |
1043 DisplayManager.refocusCurrentPod = function() { | 1037 DisplayManager.refocusCurrentPod = function() { |
1044 $('pod-row').refocusCurrentPod(); | 1038 $('pod-row').refocusCurrentPod(); |
1045 }; | 1039 }; |
1046 | 1040 |
1047 // Export | 1041 // Export |
1048 return { | 1042 return { |
1049 DisplayManager: DisplayManager | 1043 DisplayManager: DisplayManager |
1050 }; | 1044 }; |
1051 }); | 1045 }); |
OLD | NEW |