| 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 User pod row implementation. | 6 * @fileoverview User pod row implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('login', function() { | 9 cr.define('login', function() { |
| 10 /** | 10 /** |
| (...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 this.actionBoxAreaElement.setAttribute( | 1019 this.actionBoxAreaElement.setAttribute( |
| 1020 'aria-label', loadTimeData.getStringF( | 1020 'aria-label', loadTimeData.getStringF( |
| 1021 'podMenuButtonAccessibleName', this.user_.emailAddress)); | 1021 'podMenuButtonAccessibleName', this.user_.emailAddress)); |
| 1022 this.actionBoxMenuRemoveElement.setAttribute( | 1022 this.actionBoxMenuRemoveElement.setAttribute( |
| 1023 'aria-label', loadTimeData.getString( | 1023 'aria-label', loadTimeData.getString( |
| 1024 'podMenuRemoveItemAccessibleName')); | 1024 'podMenuRemoveItemAccessibleName')); |
| 1025 this.actionBoxMenuTitleNameElement.textContent = this.user_.isOwner ? | 1025 this.actionBoxMenuTitleNameElement.textContent = this.user_.isOwner ? |
| 1026 loadTimeData.getStringF('ownerUserPattern', this.user_.displayName) : | 1026 loadTimeData.getStringF('ownerUserPattern', this.user_.displayName) : |
| 1027 this.user_.displayName; | 1027 this.user_.displayName; |
| 1028 this.actionBoxMenuTitleEmailElement.textContent = this.user_.emailAddress; | 1028 this.actionBoxMenuTitleEmailElement.textContent = this.user_.emailAddress; |
| 1029 this.actionBoxMenuTitleEmailElement.hidden = this.user_.supervisedUser; | 1029 |
| 1030 this.actionBoxMenuTitleEmailElement.hidden = |
| 1031 this.user_.legacySupervisedUser; |
| 1030 | 1032 |
| 1031 this.actionBoxMenuCommandElement.textContent = | 1033 this.actionBoxMenuCommandElement.textContent = |
| 1032 loadTimeData.getString('removeUser'); | 1034 loadTimeData.getString('removeUser'); |
| 1033 }, | 1035 }, |
| 1034 | 1036 |
| 1035 customizeUserPodPerUserType: function() { | 1037 customizeUserPodPerUserType: function() { |
| 1036 if (this.user_.childUser && !this.user_.isDesktopUser) { | 1038 if (this.user_.childUser && !this.user_.isDesktopUser) { |
| 1037 this.setUserPodIconType('child'); | 1039 this.setUserPodIconType('child'); |
| 1038 } else if (this.user_.legacySupervisedUser && !this.user_.isDesktopUser) { | 1040 } else if (this.user_.legacySupervisedUser && !this.user_.isDesktopUser) { |
| 1039 this.setUserPodIconType('legacySupervised'); | 1041 this.setUserPodIconType('legacySupervised'); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 [this.user.username, this.passwordElement.value]); | 1260 [this.user.username, this.passwordElement.value]); |
| 1259 } else { | 1261 } else { |
| 1260 console.error('Activating user pod with invalid authentication type: ' + | 1262 console.error('Activating user pod with invalid authentication type: ' + |
| 1261 this.authType); | 1263 this.authType); |
| 1262 } | 1264 } |
| 1263 | 1265 |
| 1264 return true; | 1266 return true; |
| 1265 }, | 1267 }, |
| 1266 | 1268 |
| 1267 showSupervisedUserSigninWarning: function() { | 1269 showSupervisedUserSigninWarning: function() { |
| 1268 // Supervised user token has been invalidated. | 1270 // Legacy supervised user token has been invalidated. |
| 1269 // Make sure that pod is focused i.e. "Sign in" button is seen. | 1271 // Make sure that pod is focused i.e. "Sign in" button is seen. |
| 1270 this.parentNode.focusPod(this); | 1272 this.parentNode.focusPod(this); |
| 1271 | 1273 |
| 1272 var error = document.createElement('div'); | 1274 var error = document.createElement('div'); |
| 1273 var messageDiv = document.createElement('div'); | 1275 var messageDiv = document.createElement('div'); |
| 1274 messageDiv.className = 'error-message-bubble'; | 1276 messageDiv.className = 'error-message-bubble'; |
| 1275 messageDiv.textContent = | 1277 messageDiv.textContent = |
| 1276 loadTimeData.getString('supervisedUserExpiredTokenWarning'); | 1278 loadTimeData.getString('supervisedUserExpiredTokenWarning'); |
| 1277 error.appendChild(messageDiv); | 1279 error.appendChild(messageDiv); |
| 1278 | 1280 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1292 error, | 1294 error, |
| 1293 this.signinButtonElement.offsetWidth / 2, | 1295 this.signinButtonElement.offsetWidth / 2, |
| 1294 4); | 1296 4); |
| 1295 } | 1297 } |
| 1296 }, | 1298 }, |
| 1297 | 1299 |
| 1298 /** | 1300 /** |
| 1299 * Shows signin UI for this user. | 1301 * Shows signin UI for this user. |
| 1300 */ | 1302 */ |
| 1301 showSigninUI: function() { | 1303 showSigninUI: function() { |
| 1302 if (this.user.supervisedUser && !this.user.isDesktopUser) { | 1304 if (this.user.legacySupervisedUser && !this.user.isDesktopUser) { |
| 1303 this.showSupervisedUserSigninWarning(); | 1305 this.showSupervisedUserSigninWarning(); |
| 1304 } else { | 1306 } else { |
| 1305 // Special case for multi-profiles sign in. We show users even if they | 1307 // Special case for multi-profiles sign in. We show users even if they |
| 1306 // are not allowed per policy. Restrict those users from starting GAIA. | 1308 // are not allowed per policy. Restrict those users from starting GAIA. |
| 1307 if (this.multiProfilesPolicyApplied) | 1309 if (this.multiProfilesPolicyApplied) |
| 1308 return; | 1310 return; |
| 1309 | 1311 |
| 1310 this.parentNode.showSigninUI(this.user.emailAddress); | 1312 this.parentNode.showSigninUI(this.user.emailAddress); |
| 1311 } | 1313 } |
| 1312 }, | 1314 }, |
| (...skipping 1836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3149 if (pod && pod.multiProfilesPolicyApplied) { | 3151 if (pod && pod.multiProfilesPolicyApplied) { |
| 3150 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 3152 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 3151 } | 3153 } |
| 3152 } | 3154 } |
| 3153 }; | 3155 }; |
| 3154 | 3156 |
| 3155 return { | 3157 return { |
| 3156 PodRow: PodRow | 3158 PodRow: PodRow |
| 3157 }; | 3159 }; |
| 3158 }); | 3160 }); |
| OLD | NEW |