| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 * @const | 60 * @const |
| 61 */ | 61 */ |
| 62 var HELP_TOPIC_PUBLIC_SESSION = 3041033; | 62 var HELP_TOPIC_PUBLIC_SESSION = 3041033; |
| 63 | 63 |
| 64 /** | 64 /** |
| 65 * Tab order for user pods. Update these when adding new controls. | 65 * Tab order for user pods. Update these when adding new controls. |
| 66 * @enum {number} | 66 * @enum {number} |
| 67 * @const | 67 * @const |
| 68 */ | 68 */ |
| 69 var UserPodTabOrder = { | 69 var UserPodTabOrder = { |
| 70 POD_INPUT: 1, // Password input field and the pod itself. | 70 POD_INPUT: 1, // Password input field, action box menu button and |
| 71 // the pod itself. |
| 71 PIN_KEYBOARD: 2, // Pin keyboard below the password input field. | 72 PIN_KEYBOARD: 2, // Pin keyboard below the password input field. |
| 72 POD_CUSTOM_ICON: 3, // Pod custom icon next to password input field. | 73 POD_CUSTOM_ICON: 3, // Pod custom icon next to password input field. |
| 73 HEADER_BAR: 4, // Buttons on the header bar (Shutdown, Add User). | 74 HEADER_BAR: 4, // Buttons on the header bar (Shutdown, Add User). |
| 74 ACTION_BOX_BUTTON: 5, // Action box menu button. | 75 POD_MENU_ITEM: 5 // User pod menu items (User info, Remove user). |
| 75 POD_MENU_ITEM: 6 // User pod menu items (User info, Remove user). | |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 /** | 78 /** |
| 79 * Supported authentication types. Keep in sync with the enum in | 79 * Supported authentication types. Keep in sync with the enum in |
| 80 * chrome/browser/signin/screenlock_bridge.h | 80 * chrome/browser/signin/screenlock_bridge.h |
| 81 * @enum {number} | 81 * @enum {number} |
| 82 * @const | 82 * @const |
| 83 */ | 83 */ |
| 84 var AUTH_TYPE = { | 84 var AUTH_TYPE = { |
| 85 OFFLINE_PASSWORD: 0, | 85 OFFLINE_PASSWORD: 0, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 var FINGERPRINT_STATES_MAPPING = [ | 124 var FINGERPRINT_STATES_MAPPING = [ |
| 125 {state: FINGERPRINT_STATES.HIDDEN, class: 'hidden'}, | 125 {state: FINGERPRINT_STATES.HIDDEN, class: 'hidden'}, |
| 126 {state: FINGERPRINT_STATES.DEFAULT, class: 'default'}, | 126 {state: FINGERPRINT_STATES.DEFAULT, class: 'default'}, |
| 127 {state: FINGERPRINT_STATES.SIGNIN, class: 'signin'}, | 127 {state: FINGERPRINT_STATES.SIGNIN, class: 'signin'}, |
| 128 {state: FINGERPRINT_STATES.FAILED, class: 'failed'} | 128 {state: FINGERPRINT_STATES.FAILED, class: 'failed'} |
| 129 ]; | 129 ]; |
| 130 | 130 |
| 131 // Focus and tab order are organized as follows: | 131 // Focus and tab order are organized as follows: |
| 132 // | 132 // |
| 133 // (1) all user pods have tab index 1 so they are traversed first; | 133 // (1) all user pods have tab index 1 so they are traversed first; |
| 134 // (2) when a user pod is activated, its tab index is set to -1 and its | 134 // (2) when a user pod is activated, its tab index is set to -1, then its |
| 135 // main input field gets focus and tab index 1; | 135 // main input field and action box menu button get focus; |
| 136 // (3) if pin keyboard is present, it has tab index 2 so it follows the input; | 136 // (3) if pin keyboard is present, it has tab index 2 so it follows the |
| 137 // action box menu button; |
| 137 // (4) if user pod custom icon is interactive, it has tab index 3; | 138 // (4) if user pod custom icon is interactive, it has tab index 3; |
| 138 // (5) buttons on the header bar have tab index 4; | 139 // (5) buttons on the header bar have tab index 4; |
| 139 // (6) Action box buttons have tab index 5 and follow the buttons on the | 140 // (6) User pod menu items (if present) have tab index 5; |
| 140 // header bar; | 141 // (7) lastly, focus jumps to the Status Area and back to user pods. |
| 141 // (7) User pod menu items (if present) have tab index 6; | |
| 142 // (8) lastly, focus jumps to the Status Area and back to user pods. | |
| 143 // | 142 // |
| 144 // 'Focus' event is handled by a capture handler for the whole document | 143 // 'Focus' event is handled by a capture handler for the whole document |
| 145 // and in some cases 'mousedown' event handlers are used instead of 'click' | 144 // and in some cases 'mousedown' event handlers are used instead of 'click' |
| 146 // handlers where it's necessary to prevent 'focus' event from being fired. | 145 // handlers where it's necessary to prevent 'focus' event from being fired. |
| 147 | 146 |
| 148 /** | 147 /** |
| 149 * Helper function to remove a class from given element. | 148 * Helper function to remove a class from given element. |
| 150 * @param {!HTMLElement} el Element whose class list to change. | 149 * @param {!HTMLElement} el Element whose class list to change. |
| 151 * @param {string} cl Class to remove. | 150 * @param {string} cl Class to remove. |
| 152 */ | 151 */ |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 /** | 735 /** |
| 737 * True iff the pod can display the pin keyboard. The pin keyboard may not | 736 * True iff the pod can display the pin keyboard. The pin keyboard may not |
| 738 * always be displayed even if this is true, ie, if the virtual keyboard is | 737 * always be displayed even if this is true, ie, if the virtual keyboard is |
| 739 * also being displayed. | 738 * also being displayed. |
| 740 */ | 739 */ |
| 741 pinEnabled: false, | 740 pinEnabled: false, |
| 742 | 741 |
| 743 /** @override */ | 742 /** @override */ |
| 744 decorate: function() { | 743 decorate: function() { |
| 745 this.tabIndex = UserPodTabOrder.POD_INPUT; | 744 this.tabIndex = UserPodTabOrder.POD_INPUT; |
| 746 this.actionBoxAreaElement.tabIndex = UserPodTabOrder.ACTION_BOX_BUTTON; | 745 this.actionBoxAreaElement.tabIndex = UserPodTabOrder.POD_INPUT; |
| 747 | 746 |
| 748 this.addEventListener('keydown', this.handlePodKeyDown_.bind(this)); | 747 this.addEventListener('keydown', this.handlePodKeyDown_.bind(this)); |
| 749 this.addEventListener('click', this.handleClickOnPod_.bind(this)); | 748 this.addEventListener('click', this.handleClickOnPod_.bind(this)); |
| 750 this.addEventListener('mousedown', this.handlePodMouseDown_.bind(this)); | 749 this.addEventListener('mousedown', this.handlePodMouseDown_.bind(this)); |
| 751 | 750 |
| 752 if (this.pinKeyboard) { | 751 if (this.pinKeyboard) { |
| 753 this.pinKeyboard.passwordElement = this.passwordElement; | 752 this.pinKeyboard.passwordElement = this.passwordElement; |
| 754 this.pinKeyboard.addEventListener('pin-change', | 753 this.pinKeyboard.addEventListener('pin-change', |
| 755 this.handleInputChanged_.bind(this)); | 754 this.handleInputChanged_.bind(this)); |
| 756 this.pinKeyboard.tabIndex = UserPodTabOrder.PIN_KEYBOARD; | 755 this.pinKeyboard.tabIndex = UserPodTabOrder.PIN_KEYBOARD; |
| (...skipping 3816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4573 if (pod && pod.multiProfilesPolicyApplied) { | 4572 if (pod && pod.multiProfilesPolicyApplied) { |
| 4574 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 4573 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 4575 } | 4574 } |
| 4576 } | 4575 } |
| 4577 }; | 4576 }; |
| 4578 | 4577 |
| 4579 return { | 4578 return { |
| 4580 PodRow: PodRow | 4579 PodRow: PodRow |
| 4581 }; | 4580 }; |
| 4582 }); | 4581 }); |
| OLD | NEW |