| 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 2711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2722 * Add an existing user pod to this pod row. | 2722 * Add an existing user pod to this pod row. |
| 2723 * @param {!Object} user User info dictionary. | 2723 * @param {!Object} user User info dictionary. |
| 2724 */ | 2724 */ |
| 2725 addUserPod: function(user) { | 2725 addUserPod: function(user) { |
| 2726 var userPod = this.createUserPod(user); | 2726 var userPod = this.createUserPod(user); |
| 2727 this.appendChild(userPod); | 2727 this.appendChild(userPod); |
| 2728 userPod.initialize(); | 2728 userPod.initialize(); |
| 2729 }, | 2729 }, |
| 2730 | 2730 |
| 2731 /** | 2731 /** |
| 2732 * Enables or disables transitions on the user pod. | 2732 * Enables or disables transitions on every pod instance. |
| 2733 * @param {boolean} enable | 2733 * @param {boolean} enable |
| 2734 */ | 2734 */ |
| 2735 togglePinTransitions: function(enable) { | 2735 toggleTransitions: function(enable) { |
| 2736 for (var i = 0; i < this.pods.length; ++i) | 2736 for (var i = 0; i < this.pods.length; ++i) |
| 2737 this.pods[i].toggleTransitions(enable); | 2737 this.pods[i].toggleTransitions(enable); |
| 2738 }, | 2738 }, |
| 2739 | 2739 |
| 2740 /** | 2740 /** |
| 2741 * Performs visual changes on the user pod if there is an error. | 2741 * Performs visual changes on the user pod if there is an error. |
| 2742 * @param {boolean} visible Whether to show or hide the display. | 2742 * @param {boolean} visible Whether to show or hide the display. |
| 2743 */ | 2743 */ |
| 2744 setFocusedPodErrorDisplay: function(visible) { | 2744 setFocusedPodErrorDisplay: function(visible) { |
| 2745 if (this.focusedPod_) | 2745 if (this.focusedPod_) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2766 if (app) { | 2766 if (app) { |
| 2767 var activationEvent = cr.doc.createEvent('MouseEvents'); | 2767 var activationEvent = cr.doc.createEvent('MouseEvents'); |
| 2768 var ctrlKey = opt_diagnosticMode; | 2768 var ctrlKey = opt_diagnosticMode; |
| 2769 activationEvent.initMouseEvent('click', true, true, null, | 2769 activationEvent.initMouseEvent('click', true, true, null, |
| 2770 0, 0, 0, 0, 0, ctrlKey, false, false, false, 0, null); | 2770 0, 0, 0, 0, 0, ctrlKey, false, false, false, 0, null); |
| 2771 app.dispatchEvent(activationEvent); | 2771 app.dispatchEvent(activationEvent); |
| 2772 } | 2772 } |
| 2773 }, | 2773 }, |
| 2774 | 2774 |
| 2775 /** | 2775 /** |
| 2776 * Function that hides the pin keyboard. Meant to be called when the virtual | |
| 2777 * keyboard is enabled and being toggled. | |
| 2778 * @param {boolean} hidden | |
| 2779 */ | |
| 2780 setPinHidden: function(hidden) { | |
| 2781 this.setFocusedPodPinVisibility(!hidden); | |
| 2782 }, | |
| 2783 | |
| 2784 /** | |
| 2785 * Remove the pin keyboard from the pod with the given |username|. | 2776 * Remove the pin keyboard from the pod with the given |username|. |
| 2786 * @param {!user} username | 2777 * @param {!user} username |
| 2787 * @param {boolean} visible | 2778 * @param {boolean} visible |
| 2788 */ | 2779 */ |
| 2789 removePinKeyboard: function(username) { | 2780 removePinKeyboard: function(username) { |
| 2790 var pod = this.getPodWithUsername_(username); | 2781 var pod = this.getPodWithUsername_(username); |
| 2791 if (!pod) { | 2782 if (!pod) { |
| 2792 console.warn('Attempt to remove pin keyboard of missing pod.'); | 2783 console.warn('Attempt to remove pin keyboard of missing pod.'); |
| 2793 return; | 2784 return; |
| 2794 } | 2785 } |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3725 if (pod && pod.multiProfilesPolicyApplied) { | 3716 if (pod && pod.multiProfilesPolicyApplied) { |
| 3726 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 3717 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 3727 } | 3718 } |
| 3728 } | 3719 } |
| 3729 }; | 3720 }; |
| 3730 | 3721 |
| 3731 return { | 3722 return { |
| 3732 PodRow: PodRow | 3723 PodRow: PodRow |
| 3733 }; | 3724 }; |
| 3734 }); | 3725 }); |
| OLD | NEW |