Chromium Code Reviews| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 * @type {boolean} | 171 * @type {boolean} |
| 172 */ | 172 */ |
| 173 forceKeyboardFlow_: false, | 173 forceKeyboardFlow_: false, |
| 174 | 174 |
| 175 /** | 175 /** |
| 176 * Type of UI. | 176 * Type of UI. |
| 177 * @type {string} | 177 * @type {string} |
| 178 */ | 178 */ |
| 179 displayType_: DISPLAY_TYPE.UNKNOWN, | 179 displayType_: DISPLAY_TYPE.UNKNOWN, |
| 180 | 180 |
| 181 /** | |
| 182 * Error message (bubble) was shown. This is checked in tests. | |
| 183 */ | |
| 184 errorMessageWasShownForTesting_: false, | |
|
achuithb
2014/05/07 20:38:32
We have a number of testing apis here:
https://cod
Alexander Alekseev
2014/05/07 21:00:16
I think the less code "for testing only" we add to
achuithb
2014/05/07 21:10:03
sg
| |
| 185 | |
| 181 get displayType() { | 186 get displayType() { |
| 182 return this.displayType_; | 187 return this.displayType_; |
| 183 }, | 188 }, |
| 184 | 189 |
| 185 set displayType(displayType) { | 190 set displayType(displayType) { |
| 186 this.displayType_ = displayType; | 191 this.displayType_ = displayType; |
| 187 document.documentElement.setAttribute('screen', displayType); | 192 document.documentElement.setAttribute('screen', displayType); |
| 188 }, | 193 }, |
| 189 | 194 |
| 190 get newKioskUI() { | 195 get newKioskUI() { |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 869 helpLink.href = '#'; | 874 helpLink.href = '#'; |
| 870 helpLink.textContent = link; | 875 helpLink.textContent = link; |
| 871 helpLink.addEventListener('click', function(e) { | 876 helpLink.addEventListener('click', function(e) { |
| 872 chrome.send('launchHelpApp', [helpId]); | 877 chrome.send('launchHelpApp', [helpId]); |
| 873 e.preventDefault(); | 878 e.preventDefault(); |
| 874 }); | 879 }); |
| 875 error.appendChild(helpLink); | 880 error.appendChild(helpLink); |
| 876 } | 881 } |
| 877 | 882 |
| 878 var currentScreen = Oobe.getInstance().currentScreen; | 883 var currentScreen = Oobe.getInstance().currentScreen; |
| 879 if (currentScreen && typeof currentScreen.showErrorBubble === 'function') | 884 if (currentScreen && typeof currentScreen.showErrorBubble === 'function') { |
| 880 currentScreen.showErrorBubble(loginAttempts, error); | 885 currentScreen.showErrorBubble(loginAttempts, error); |
| 886 this.errorMessageWasShownForTesting_ = true; | |
| 887 } | |
| 881 }; | 888 }; |
| 882 | 889 |
| 883 /** | 890 /** |
| 884 * Shows password changed screen that offers migration. | 891 * Shows password changed screen that offers migration. |
| 885 * @param {boolean} showError Whether to show the incorrect password error. | 892 * @param {boolean} showError Whether to show the incorrect password error. |
| 886 */ | 893 */ |
| 887 DisplayManager.showPasswordChangedScreen = function(showError) { | 894 DisplayManager.showPasswordChangedScreen = function(showError) { |
| 888 login.PasswordChangedScreen.show(showError); | 895 login.PasswordChangedScreen.show(showError); |
| 889 }; | 896 }; |
| 890 | 897 |
| 891 /** | 898 /** |
| 892 * Shows dialog to create managed user. | 899 * Shows dialog to create managed user. |
| 893 */ | 900 */ |
| 894 DisplayManager.showManagedUserCreationScreen = function() { | 901 DisplayManager.showManagedUserCreationScreen = function() { |
| 895 login.ManagedUserCreationScreen.show(); | 902 login.ManagedUserCreationScreen.show(); |
| 896 }; | 903 }; |
| 897 | 904 |
| 898 /** | 905 /** |
| 899 * Shows TPM error screen. | 906 * Shows TPM error screen. |
| 900 */ | 907 */ |
| 901 DisplayManager.showTpmError = function() { | 908 DisplayManager.showTpmError = function() { |
| 902 login.TPMErrorMessageScreen.show(); | 909 login.TPMErrorMessageScreen.show(); |
| 903 }; | 910 }; |
| 904 | 911 |
| 905 /** | 912 /** |
| 906 * Clears error bubble. | 913 * Clears error bubble. |
| 907 */ | 914 */ |
| 908 DisplayManager.clearErrors = function() { | 915 DisplayManager.clearErrors = function() { |
| 909 $('bubble').hide(); | 916 $('bubble').hide(); |
| 917 this.errorMessageWasShownForTesting_ = false; | |
| 910 }; | 918 }; |
| 911 | 919 |
| 912 /** | 920 /** |
| 913 * Sets text content for a div with |labelId|. | 921 * Sets text content for a div with |labelId|. |
| 914 * @param {string} labelId Id of the label div. | 922 * @param {string} labelId Id of the label div. |
| 915 * @param {string} labelText Text for the label. | 923 * @param {string} labelText Text for the label. |
| 916 */ | 924 */ |
| 917 DisplayManager.setLabelText = function(labelId, labelText) { | 925 DisplayManager.setLabelText = function(labelId, labelText) { |
| 918 $(labelId).textContent = labelText; | 926 $(labelId).textContent = labelText; |
| 919 }; | 927 }; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 953 */ | 961 */ |
| 954 DisplayManager.refocusCurrentPod = function() { | 962 DisplayManager.refocusCurrentPod = function() { |
| 955 $('pod-row').refocusCurrentPod(); | 963 $('pod-row').refocusCurrentPod(); |
| 956 }; | 964 }; |
| 957 | 965 |
| 958 // Export | 966 // Export |
| 959 return { | 967 return { |
| 960 DisplayManager: DisplayManager | 968 DisplayManager: DisplayManager |
| 961 }; | 969 }; |
| 962 }); | 970 }); |
| OLD | NEW |