| 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 2556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2567 if (app) { | 2567 if (app) { |
| 2568 var activationEvent = cr.doc.createEvent('MouseEvents'); | 2568 var activationEvent = cr.doc.createEvent('MouseEvents'); |
| 2569 var ctrlKey = opt_diagnosticMode; | 2569 var ctrlKey = opt_diagnosticMode; |
| 2570 activationEvent.initMouseEvent('click', true, true, null, | 2570 activationEvent.initMouseEvent('click', true, true, null, |
| 2571 0, 0, 0, 0, 0, ctrlKey, false, false, false, 0, null); | 2571 0, 0, 0, 0, 0, ctrlKey, false, false, false, 0, null); |
| 2572 app.dispatchEvent(activationEvent); | 2572 app.dispatchEvent(activationEvent); |
| 2573 } | 2573 } |
| 2574 }, | 2574 }, |
| 2575 | 2575 |
| 2576 /** | 2576 /** |
| 2577 * Toggles pod PIN keyboard visiblity. |
| 2578 * @param {!user} username |
| 2579 * @param {boolean} visible |
| 2580 */ |
| 2581 setPinVisibility: function(username, visible) { |
| 2582 var pod = this.getPodWithUsername_(username); |
| 2583 if (!pod) { |
| 2584 console.warn('Attempt to change pin visibility to ' + visible + |
| 2585 ' for missing pod'); |
| 2586 return; |
| 2587 } |
| 2588 |
| 2589 pod.setPinVisibility(visible); |
| 2590 }, |
| 2591 |
| 2592 /** |
| 2577 * Removes user pod from pod row. | 2593 * Removes user pod from pod row. |
| 2578 * @param {string} email User's email. | 2594 * @param {!user} username |
| 2579 */ | 2595 */ |
| 2580 removeUserPod: function(username) { | 2596 removeUserPod: function(username) { |
| 2581 var podToRemove = this.getPodWithUsername_(username); | 2597 var podToRemove = this.getPodWithUsername_(username); |
| 2582 if (podToRemove == null) { | 2598 if (podToRemove == null) { |
| 2583 console.warn('Attempt to remove not existing pod for ' + username + | 2599 console.warn('Attempt to remove pod that does not exist'); |
| 2584 '.'); | |
| 2585 return; | 2600 return; |
| 2586 } | 2601 } |
| 2587 this.removeChild(podToRemove); | 2602 this.removeChild(podToRemove); |
| 2588 if (this.pods.length > 0) | 2603 if (this.pods.length > 0) |
| 2589 this.placePods_(); | 2604 this.placePods_(); |
| 2590 }, | 2605 }, |
| 2591 | 2606 |
| 2592 /** | 2607 /** |
| 2593 * Returns index of given pod or -1 if not found. | 2608 * Returns index of given pod or -1 if not found. |
| 2594 * @param {UserPod} pod Pod to look up. | 2609 * @param {UserPod} pod Pod to look up. |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3473 if (pod && pod.multiProfilesPolicyApplied) { | 3488 if (pod && pod.multiProfilesPolicyApplied) { |
| 3474 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 3489 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 3475 } | 3490 } |
| 3476 } | 3491 } |
| 3477 }; | 3492 }; |
| 3478 | 3493 |
| 3479 return { | 3494 return { |
| 3480 PodRow: PodRow | 3495 PodRow: PodRow |
| 3481 }; | 3496 }; |
| 3482 }); | 3497 }); |
| OLD | NEW |