Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: chrome/browser/resources/login/user_pod_row.js

Issue 403343002: Rename "managed (mode|user)" to "supervised user" (part 8) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix2 Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 this.actionBoxAreaElement.setAttribute( 478 this.actionBoxAreaElement.setAttribute(
479 'aria-label', loadTimeData.getStringF( 479 'aria-label', loadTimeData.getStringF(
480 'podMenuButtonAccessibleName', this.user_.emailAddress)); 480 'podMenuButtonAccessibleName', this.user_.emailAddress));
481 this.actionBoxMenuRemoveElement.setAttribute( 481 this.actionBoxMenuRemoveElement.setAttribute(
482 'aria-label', loadTimeData.getString( 482 'aria-label', loadTimeData.getString(
483 'podMenuRemoveItemAccessibleName')); 483 'podMenuRemoveItemAccessibleName'));
484 this.actionBoxMenuTitleNameElement.textContent = this.user_.isOwner ? 484 this.actionBoxMenuTitleNameElement.textContent = this.user_.isOwner ?
485 loadTimeData.getStringF('ownerUserPattern', this.user_.displayName) : 485 loadTimeData.getStringF('ownerUserPattern', this.user_.displayName) :
486 this.user_.displayName; 486 this.user_.displayName;
487 this.actionBoxMenuTitleEmailElement.textContent = this.user_.emailAddress; 487 this.actionBoxMenuTitleEmailElement.textContent = this.user_.emailAddress;
488 this.actionBoxMenuTitleEmailElement.hidden = 488 this.actionBoxMenuTitleEmailElement.hidden = this.user_.supervisedUser;
489 this.user_.locallyManagedUser;
490 489
491 this.actionBoxMenuCommandElement.textContent = 490 this.actionBoxMenuCommandElement.textContent =
492 loadTimeData.getString('removeUser'); 491 loadTimeData.getString('removeUser');
493 }, 492 },
494 493
495 customizeUserPodPerUserType: function() { 494 customizeUserPodPerUserType: function() {
496 if (this.user_.locallyManagedUser && !this.user_.isDesktopUser) { 495 if (this.user_.supervisedUser && !this.user_.isDesktopUser) {
497 this.setUserPodIconType('supervised'); 496 this.setUserPodIconType('supervised');
498 } else if (this.multiProfilesPolicyApplied) { 497 } else if (this.multiProfilesPolicyApplied) {
499 // Mark user pod as not focusable which in addition to the grayed out 498 // Mark user pod as not focusable which in addition to the grayed out
500 // filter makes it look in disabled state. 499 // filter makes it look in disabled state.
501 this.classList.add('multiprofiles-policy-applied'); 500 this.classList.add('multiprofiles-policy-applied');
502 this.setUserPodIconType('policy'); 501 this.setUserPodIconType('policy');
503 502
504 if (this.user.multiProfilesPolicy == 'primary-only') 503 if (this.user.multiProfilesPolicy == 'primary-only')
505 this.querySelector('.mp-policy-primary-only-msg').hidden = false; 504 this.querySelector('.mp-policy-primary-only-msg').hidden = false;
506 else if (this.user.multiProfilesPolicy == 'owner-primary-only') 505 else if (this.user.multiProfilesPolicy == 'owner-primary-only')
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 [this.user.username, this.passwordElement.value]); 698 [this.user.username, this.passwordElement.value]);
700 } else { 699 } else {
701 console.error('Activating user pod with invalid authentication type: ' + 700 console.error('Activating user pod with invalid authentication type: ' +
702 this.authType); 701 this.authType);
703 } 702 }
704 703
705 return true; 704 return true;
706 }, 705 },
707 706
708 showSupervisedUserSigninWarning: function() { 707 showSupervisedUserSigninWarning: function() {
709 // Locally managed user token has been invalidated. 708 // Supervised user token has been invalidated.
710 // Make sure that pod is focused i.e. "Sign in" button is seen. 709 // Make sure that pod is focused i.e. "Sign in" button is seen.
711 this.parentNode.focusPod(this); 710 this.parentNode.focusPod(this);
712 711
713 var error = document.createElement('div'); 712 var error = document.createElement('div');
714 var messageDiv = document.createElement('div'); 713 var messageDiv = document.createElement('div');
715 messageDiv.className = 'error-message-bubble'; 714 messageDiv.className = 'error-message-bubble';
716 messageDiv.textContent = 715 messageDiv.textContent =
717 loadTimeData.getString('supervisedUserExpiredTokenWarning'); 716 loadTimeData.getString('supervisedUserExpiredTokenWarning');
718 error.appendChild(messageDiv); 717 error.appendChild(messageDiv);
719 718
720 $('bubble').showContentForElement( 719 $('bubble').showContentForElement(
721 this.signinButtonElement, 720 this.signinButtonElement,
722 cr.ui.Bubble.Attachment.TOP, 721 cr.ui.Bubble.Attachment.TOP,
723 error, 722 error,
724 this.signinButtonElement.offsetWidth / 2, 723 this.signinButtonElement.offsetWidth / 2,
725 4); 724 4);
726 }, 725 },
727 726
728 /** 727 /**
729 * Shows signin UI for this user. 728 * Shows signin UI for this user.
730 */ 729 */
731 showSigninUI: function() { 730 showSigninUI: function() {
732 if (this.user.locallyManagedUser && !this.user.isDesktopUser) { 731 if (this.user.supervisedUser && !this.user.isDesktopUser) {
733 this.showSupervisedUserSigninWarning(); 732 this.showSupervisedUserSigninWarning();
734 } else { 733 } else {
735 // Special case for multi-profiles sign in. We show users even if they 734 // Special case for multi-profiles sign in. We show users even if they
736 // are not allowed per policy. Restrict those users from starting GAIA. 735 // are not allowed per policy. Restrict those users from starting GAIA.
737 if (this.multiProfilesPolicyApplied) 736 if (this.multiProfilesPolicyApplied)
738 return; 737 return;
739 738
740 this.parentNode.showSigninUI(this.user.emailAddress); 739 this.parentNode.showSigninUI(this.user.emailAddress);
741 } 740 }
742 }, 741 },
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 this.isActionBoxMenuActive = false; 808 this.isActionBoxMenuActive = false;
810 break; 809 break;
811 } 810 }
812 }, 811 },
813 812
814 /** 813 /**
815 * Handles a click event on remove user command. 814 * Handles a click event on remove user command.
816 * @param {Event} e Click event. 815 * @param {Event} e Click event.
817 */ 816 */
818 handleRemoveCommandClick_: function(e) { 817 handleRemoveCommandClick_: function(e) {
819 if (this.user.locallyManagedUser || this.user.isDesktopUser) { 818 if (this.user.supervisedUser || this.user.isDesktopUser) {
820 this.showRemoveWarning_(); 819 this.showRemoveWarning_();
821 return; 820 return;
822 } 821 }
823 if (this.isActionBoxMenuActive) 822 if (this.isActionBoxMenuActive)
824 chrome.send('removeUser', [this.user.username]); 823 chrome.send('removeUser', [this.user.username]);
825 }, 824 },
826 825
827 /** 826 /**
828 * Shows remove user warning. Used for supervised users on CrOS, and for all 827 * Shows remove user warning. Used for supervised users on CrOS, and for all
829 * users on desktop. 828 * users on desktop.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 866
868 /** 867 /**
869 * Handles a keydown event on remove command. 868 * Handles a keydown event on remove command.
870 * @param {Event} e KeyDown event. 869 * @param {Event} e KeyDown event.
871 */ 870 */
872 handleRemoveCommandKeyDown_: function(e) { 871 handleRemoveCommandKeyDown_: function(e) {
873 if (this.disabled) 872 if (this.disabled)
874 return; 873 return;
875 switch (e.keyIdentifier) { 874 switch (e.keyIdentifier) {
876 case 'Enter': 875 case 'Enter':
877 if (this.user.locallyManagedUser || this.user.isDesktopUser) { 876 if (this.user.supervisedUser || this.user.isDesktopUser) {
878 // Prevent default so that we don't trigger a 'click' event on the 877 // Prevent default so that we don't trigger a 'click' event on the
879 // remove button that will be focused. 878 // remove button that will be focused.
880 e.preventDefault(); 879 e.preventDefault();
881 this.showRemoveWarning_(); 880 this.showRemoveWarning_();
882 } else { 881 } else {
883 this.removeUser(this.user); 882 this.removeUser(this.user);
884 } 883 }
885 e.stopPropagation(); 884 e.stopPropagation();
886 break; 885 break;
887 case 'Up': 886 case 'Up':
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 else 1162 else
1164 return this.nameElement; 1163 return this.nameElement;
1165 }, 1164 },
1166 1165
1167 /** @override */ 1166 /** @override */
1168 update: function() { 1167 update: function() {
1169 this.imageElement.src = this.user.userImage; 1168 this.imageElement.src = this.user.userImage;
1170 this.nameElement.textContent = this.user.displayName; 1169 this.nameElement.textContent = this.user.displayName;
1171 1170
1172 var isLockedUser = this.user.needsSignin; 1171 var isLockedUser = this.user.needsSignin;
1173 var isSupervisedUser = this.user.locallyManagedUser; 1172 var isSupervisedUser = this.user.supervisedUser;
1174 this.classList.toggle('locked', isLockedUser); 1173 this.classList.toggle('locked', isLockedUser);
1175 this.classList.toggle('supervised-user', isSupervisedUser); 1174 this.classList.toggle('supervised-user', isSupervisedUser);
1176 1175
1177 if (this.isAuthTypeUserClick) 1176 if (this.isAuthTypeUserClick)
1178 this.passwordLabelElement.textContent = this.authValue; 1177 this.passwordLabelElement.textContent = this.authValue;
1179 1178
1180 this.actionBoxRemoveUserWarningTextElement.hidden = isSupervisedUser; 1179 this.actionBoxRemoveUserWarningTextElement.hidden = isSupervisedUser;
1181 this.actionBoxRemoveSupervisedUserWarningTextElement.hidden = 1180 this.actionBoxRemoveSupervisedUserWarningTextElement.hidden =
1182 !isSupervisedUser; 1181 !isSupervisedUser;
1183 1182
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
2293 if (this.podsWithPendingImages_.length == 0) { 2292 if (this.podsWithPendingImages_.length == 0) {
2294 this.classList.remove('images-loading'); 2293 this.classList.remove('images-loading');
2295 } 2294 }
2296 } 2295 }
2297 }; 2296 };
2298 2297
2299 return { 2298 return {
2300 PodRow: PodRow 2299 PodRow: PodRow
2301 }; 2300 };
2302 }); 2301 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698