| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 this.onConfirmDeviceRequisitionPrompt_.bind(this)); | 589 this.onConfirmDeviceRequisitionPrompt_.bind(this)); |
| 590 }, | 590 }, |
| 591 | 591 |
| 592 /** | 592 /** |
| 593 * Confirmation handle for the device requisition prompt. | 593 * Confirmation handle for the device requisition prompt. |
| 594 * @param {string} value The value entered by the user. | 594 * @param {string} value The value entered by the user. |
| 595 * @private | 595 * @private |
| 596 */ | 596 */ |
| 597 onConfirmDeviceRequisitionPrompt_: function(value) { | 597 onConfirmDeviceRequisitionPrompt_: function(value) { |
| 598 this.deviceRequisition_ = value; | 598 this.deviceRequisition_ = value; |
| 599 chrome.send('setDeviceRequisition', [value]); | 599 chrome.send('setDeviceRequisition', [value == '' ? 'none' : value]); |
| 600 }, | 600 }, |
| 601 | 601 |
| 602 /** | 602 /** |
| 603 * Called when window size changed. Notifies current screen about change. | 603 * Called when window size changed. Notifies current screen about change. |
| 604 * @private | 604 * @private |
| 605 */ | 605 */ |
| 606 onWindowResize_: function() { | 606 onWindowResize_: function() { |
| 607 var currentScreenId = this.screens_[this.currentStep_]; | 607 var currentScreenId = this.screens_[this.currentStep_]; |
| 608 var currentScreen = $(currentScreenId); | 608 var currentScreen = $(currentScreenId); |
| 609 if (currentScreen) | 609 if (currentScreen) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 626 if (!this.deviceRequisitionRemoraDialog_) { | 626 if (!this.deviceRequisitionRemoraDialog_) { |
| 627 this.deviceRequisitionRemoraDialog_ = | 627 this.deviceRequisitionRemoraDialog_ = |
| 628 new cr.ui.dialogs.ConfirmDialog(document.body); | 628 new cr.ui.dialogs.ConfirmDialog(document.body); |
| 629 this.deviceRequisitionRemoraDialog_.setOkLabel( | 629 this.deviceRequisitionRemoraDialog_.setOkLabel( |
| 630 loadTimeData.getString('deviceRequisitionRemoraPromptOk')); | 630 loadTimeData.getString('deviceRequisitionRemoraPromptOk')); |
| 631 this.deviceRequisitionRemoraDialog_.setCancelLabel( | 631 this.deviceRequisitionRemoraDialog_.setCancelLabel( |
| 632 loadTimeData.getString('deviceRequisitionRemoraPromptCancel')); | 632 loadTimeData.getString('deviceRequisitionRemoraPromptCancel')); |
| 633 } | 633 } |
| 634 this.deviceRequisitionRemoraDialog_.show( | 634 this.deviceRequisitionRemoraDialog_.show( |
| 635 loadTimeData.getString('deviceRequisitionRemoraPromptText'), | 635 loadTimeData.getString('deviceRequisitionRemoraPromptText'), |
| 636 function() { | 636 function() { // onShow |
| 637 chrome.send('setDeviceRequisition', ['remora']); | 637 chrome.send('setDeviceRequisition', ['remora']); |
| 638 }, |
| 639 function() { // onCancel |
| 640 chrome.send('setDeviceRequisition', ['none']); |
| 638 }); | 641 }); |
| 639 }, | 642 }, |
| 640 | 643 |
| 641 /** | 644 /** |
| 642 * Returns true if Oobe UI is shown. | 645 * Returns true if Oobe UI is shown. |
| 643 */ | 646 */ |
| 644 isOobeUI: function() { | 647 isOobeUI: function() { |
| 645 return document.body.classList.contains('oobe-display'); | 648 return document.body.classList.contains('oobe-display'); |
| 646 }, | 649 }, |
| 647 | 650 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 */ | 865 */ |
| 863 DisplayManager.refocusCurrentPod = function() { | 866 DisplayManager.refocusCurrentPod = function() { |
| 864 $('pod-row').refocusCurrentPod(); | 867 $('pod-row').refocusCurrentPod(); |
| 865 }; | 868 }; |
| 866 | 869 |
| 867 // Export | 870 // Export |
| 868 return { | 871 return { |
| 869 DisplayManager: DisplayManager | 872 DisplayManager: DisplayManager |
| 870 }; | 873 }; |
| 871 }); | 874 }); |
| OLD | NEW |