Chromium Code Reviews| 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 Oobe signin screen implementation. | 6 * @fileoverview Oobe signin screen implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { | 9 login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
| 10 // GAIA animation guard timer. Started when GAIA page is loaded | 10 // GAIA animation guard timer. Started when GAIA page is loaded |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 AD_AUTH: 3 // Offline Active Directory login flow. | 43 AD_AUTH: 3 // Offline Active Directory login flow. |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 return { | 46 return { |
| 47 EXTERNAL_API: [ | 47 EXTERNAL_API: [ |
| 48 'loadAuthExtension', | 48 'loadAuthExtension', |
| 49 'doReload', | 49 'doReload', |
| 50 'monitorOfflineIdle', | 50 'monitorOfflineIdle', |
| 51 'updateControlsState', | 51 'updateControlsState', |
| 52 'showWhitelistCheckFailedError', | 52 'showWhitelistCheckFailedError', |
| 53 'invalidateAd', | |
|
achuithb
2017/01/18 19:22:48
Shouldn't this be invalidateAD?
| |
| 53 ], | 54 ], |
| 54 | 55 |
| 55 /** | 56 /** |
| 56 * Saved gaia auth host load params. | 57 * Saved gaia auth host load params. |
| 57 * @type {?string} | 58 * @type {?string} |
| 58 * @private | 59 * @private |
| 59 */ | 60 */ |
| 60 gaiaAuthParams_: null, | 61 gaiaAuthParams_: null, |
| 61 | 62 |
| 62 /** | 63 /** |
| (...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1083 }, | 1084 }, |
| 1084 | 1085 |
| 1085 loadAdAuth: function(params) { | 1086 loadAdAuth: function(params) { |
| 1086 this.loading = true; | 1087 this.loading = true; |
| 1087 this.startLoadingTimer_(); | 1088 this.startLoadingTimer_(); |
| 1088 var ADAuthUI = this.getSigninFrame_(); | 1089 var ADAuthUI = this.getSigninFrame_(); |
| 1089 if ('realm' in params) { | 1090 if ('realm' in params) { |
| 1090 ADAuthUI.realm = params['realm']; | 1091 ADAuthUI.realm = params['realm']; |
| 1091 ADAuthUI.userRealm = '@' + params['realm']; | 1092 ADAuthUI.userRealm = '@' + params['realm']; |
| 1092 } | 1093 } |
| 1094 if ('email' in params) | |
| 1095 ADAuthUI.setUser(params['email']); | |
| 1093 this.onAuthReady_(); | 1096 this.onAuthReady_(); |
| 1094 }, | 1097 }, |
| 1095 | 1098 |
| 1096 /** | 1099 /** |
| 1097 * Show/Hide error when user is not in whitelist. When UI is hidden | 1100 * Show/Hide error when user is not in whitelist. When UI is hidden |
| 1098 * GAIA is reloaded. | 1101 * GAIA is reloaded. |
| 1099 * @param {boolean} show Show/hide error UI. | 1102 * @param {boolean} show Show/hide error UI. |
| 1100 * @param {!Object} opt_data Optional additional information. | 1103 * @param {!Object} opt_data Optional additional information. |
| 1101 */ | 1104 */ |
| 1102 showWhitelistCheckFailedError: function(show, opt_data) { | 1105 showWhitelistCheckFailedError: function(show, opt_data) { |
| 1103 if (show) { | 1106 if (show) { |
| 1104 var isManaged = opt_data && opt_data.enterpriseManaged; | 1107 var isManaged = opt_data && opt_data.enterpriseManaged; |
| 1105 $('gaia-whitelist-error').textContent = | 1108 $('gaia-whitelist-error').textContent = |
| 1106 loadTimeData.getValue(isManaged ? 'whitelistErrorEnterprise' : | 1109 loadTimeData.getValue(isManaged ? 'whitelistErrorEnterprise' : |
| 1107 'whitelistErrorConsumer'); | 1110 'whitelistErrorConsumer'); |
| 1108 } | 1111 } |
| 1109 | 1112 |
| 1110 this.classList.toggle('whitelist-error', show); | 1113 this.classList.toggle('whitelist-error', show); |
| 1111 this.loading = !show; | 1114 this.loading = !show; |
| 1112 | 1115 |
| 1113 if (show) | 1116 if (show) |
| 1114 $('gaia-whitelist-error').submitButton.focus(); | 1117 $('gaia-whitelist-error').submitButton.focus(); |
| 1115 else | 1118 else |
| 1116 Oobe.showSigninUI(); | 1119 Oobe.showSigninUI(); |
| 1117 | 1120 |
| 1118 this.updateControlsState(); | 1121 this.updateControlsState(); |
| 1122 }, | |
| 1123 | |
| 1124 invalidateAd: function(username) { | |
| 1125 if (this.screenMode_ != ScreenMode.AD_AUTH) | |
| 1126 return; | |
| 1127 var adAuthUI = this.getSigninFrame_(); | |
| 1128 adAuthUI.setUser(username); | |
| 1129 adAuthUI.setInvalid(ACTIVE_DIRECTORY_ERROR_STATE.BAD_PASSWORD); | |
| 1130 this.loading = false; | |
| 1119 } | 1131 } |
| 1120 }; | 1132 }; |
| 1121 }); | 1133 }); |
| OLD | NEW |