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 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2428 * @param {!{id: !string, | 2428 * @param {!{id: !string, |
2429 * hardlockOnClick: boolean, | 2429 * hardlockOnClick: boolean, |
2430 * isTrialRun: boolean, | 2430 * isTrialRun: boolean, |
2431 * ariaLabel: string | undefined, | 2431 * ariaLabel: string | undefined, |
2432 * tooltip: ({text: string, autoshow: boolean} | undefined)}} icon | 2432 * tooltip: ({text: string, autoshow: boolean} | undefined)}} icon |
2433 * The icon parameters. | 2433 * The icon parameters. |
2434 */ | 2434 */ |
2435 showUserPodCustomIcon: function(username, icon) { | 2435 showUserPodCustomIcon: function(username, icon) { |
2436 var pod = this.getPodWithUsername_(username); | 2436 var pod = this.getPodWithUsername_(username); |
2437 if (pod == null) { | 2437 if (pod == null) { |
2438 console.error('Unable to show user pod button for ' + username + | 2438 console.error('Unable to show user pod button: user pod not found.'); |
2439 ': user pod not found.'); | |
2440 return; | 2439 return; |
2441 } | 2440 } |
2442 | 2441 |
2443 if (!icon.id && !icon.tooltip) | 2442 if (!icon.id && !icon.tooltip) |
2444 return; | 2443 return; |
2445 | 2444 |
2446 if (icon.id) | 2445 if (icon.id) |
2447 pod.customIconElement.setIcon(icon.id); | 2446 pod.customIconElement.setIcon(icon.id); |
2448 | 2447 |
2449 if (icon.isTrialRun) { | 2448 if (icon.isTrialRun) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2491 chrome.send('recordClickOnLockIcon', [username]); | 2490 chrome.send('recordClickOnLockIcon', [username]); |
2492 }, | 2491 }, |
2493 | 2492 |
2494 /** | 2493 /** |
2495 * Hides the custom icon in the user pod added by showUserPodCustomIcon(). | 2494 * Hides the custom icon in the user pod added by showUserPodCustomIcon(). |
2496 * @param {string} username Username of pod to remove button | 2495 * @param {string} username Username of pod to remove button |
2497 */ | 2496 */ |
2498 hideUserPodCustomIcon: function(username) { | 2497 hideUserPodCustomIcon: function(username) { |
2499 var pod = this.getPodWithUsername_(username); | 2498 var pod = this.getPodWithUsername_(username); |
2500 if (pod == null) { | 2499 if (pod == null) { |
2501 console.error('Unable to hide user pod button for ' + username + | 2500 console.error('Unable to hide user pod button: user pod not found.'); |
2502 ': user pod not found.'); | |
2503 return; | 2501 return; |
2504 } | 2502 } |
2505 | 2503 |
2506 // TODO(tengs): Allow option for a fading transition. | 2504 // TODO(tengs): Allow option for a fading transition. |
2507 pod.customIconElement.hide(); | 2505 pod.customIconElement.hide(); |
2508 }, | 2506 }, |
2509 | 2507 |
2510 /** | 2508 /** |
2511 * Sets the authentication type used to authenticate the user. | 2509 * Sets the authentication type used to authenticate the user. |
2512 * @param {string} username Username of selected user | 2510 * @param {string} username Username of selected user |
2513 * @param {number} authType Authentication type, must be one of the | 2511 * @param {number} authType Authentication type, must be one of the |
2514 * values listed in AUTH_TYPE enum. | 2512 * values listed in AUTH_TYPE enum. |
2515 * @param {string} value The initial value to use for authentication. | 2513 * @param {string} value The initial value to use for authentication. |
2516 */ | 2514 */ |
2517 setAuthType: function(username, authType, value) { | 2515 setAuthType: function(username, authType, value) { |
2518 var pod = this.getPodWithUsername_(username); | 2516 var pod = this.getPodWithUsername_(username); |
2519 if (pod == null) { | 2517 if (pod == null) { |
2520 console.error('Unable to set auth type for ' + username + | 2518 console.error('Unable to set auth type: user pod not found.'); |
2521 ': user pod not found.'); | |
2522 return; | 2519 return; |
2523 } | 2520 } |
2524 pod.setAuthType(authType, value); | 2521 pod.setAuthType(authType, value); |
2525 }, | 2522 }, |
2526 | 2523 |
2527 /** | 2524 /** |
2528 * Sets the state of touch view mode. | 2525 * Sets the state of touch view mode. |
2529 * @param {boolean} isTouchViewEnabled true if the mode is on. | 2526 * @param {boolean} isTouchViewEnabled true if the mode is on. |
2530 */ | 2527 */ |
2531 setTouchViewState: function(isTouchViewEnabled) { | 2528 setTouchViewState: function(isTouchViewEnabled) { |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3152 if (pod && pod.multiProfilesPolicyApplied) { | 3149 if (pod && pod.multiProfilesPolicyApplied) { |
3153 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 3150 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
3154 } | 3151 } |
3155 } | 3152 } |
3156 }; | 3153 }; |
3157 | 3154 |
3158 return { | 3155 return { |
3159 PodRow: PodRow | 3156 PodRow: PodRow |
3160 }; | 3157 }; |
3161 }); | 3158 }); |
OLD | NEW |