Chromium Code Reviews| 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 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1583 /** | 1583 /** |
| 1584 * Returns all the pods in this pod row. | 1584 * Returns all the pods in this pod row. |
| 1585 * @type {NodeList} | 1585 * @type {NodeList} |
| 1586 */ | 1586 */ |
| 1587 get pods() { | 1587 get pods() { |
| 1588 return Array.prototype.slice.call(this.children); | 1588 return Array.prototype.slice.call(this.children); |
| 1589 }, | 1589 }, |
| 1590 | 1590 |
| 1591 /** | 1591 /** |
| 1592 * Return true if user pod row has only single user pod in it, which should | 1592 * Return true if user pod row has only single user pod in it, which should |
| 1593 * always be focused. | 1593 * always be focused when Touch View mode is disabled.. |
|
Nikita (slow)
2014/08/14 15:48:00
nit: You should mention desktop mode as well.
merkulova
2014/08/14 15:56:02
Done.
| |
| 1594 * @type {boolean} | 1594 * @type {boolean} |
| 1595 */ | 1595 */ |
| 1596 get alwaysFocusSinglePod() { | 1596 get alwaysFocusSinglePod() { |
| 1597 var isDesktopUserManager = Oobe.getInstance().displayType == | 1597 var isDesktopUserManager = Oobe.getInstance().displayType == |
| 1598 DISPLAY_TYPE.DESKTOP_USER_MANAGER; | 1598 DISPLAY_TYPE.DESKTOP_USER_MANAGER; |
| 1599 | 1599 |
| 1600 return isDesktopUserManager ? false : this.children.length == 1; | 1600 return (isDesktopUserManager || this.touchViewEnabled_) ? |
| 1601 false : this.children.length == 1; | |
| 1601 }, | 1602 }, |
| 1602 | 1603 |
| 1603 /** | 1604 /** |
| 1604 * Returns pod with the given app id. | 1605 * Returns pod with the given app id. |
| 1605 * @param {!string} app_id Application id to be matched. | 1606 * @param {!string} app_id Application id to be matched. |
| 1606 * @return {Object} Pod with the given app id. null if pod hasn't been | 1607 * @return {Object} Pod with the given app id. null if pod hasn't been |
| 1607 * found. | 1608 * found. |
| 1608 */ | 1609 */ |
| 1609 getPodWithAppId_: function(app_id) { | 1610 getPodWithAppId_: function(app_id) { |
| 1610 for (var i = 0, pod; pod = this.pods[i]; ++i) { | 1611 for (var i = 0, pod; pod = this.pods[i]; ++i) { |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1887 var pod = this.getPodWithUsername_(username); | 1888 var pod = this.getPodWithUsername_(username); |
| 1888 if (pod == null) { | 1889 if (pod == null) { |
| 1889 console.error('Unable to set auth type for ' + username + | 1890 console.error('Unable to set auth type for ' + username + |
| 1890 ': user pod not found.'); | 1891 ': user pod not found.'); |
| 1891 return; | 1892 return; |
| 1892 } | 1893 } |
| 1893 pod.setAuthType(authType, value); | 1894 pod.setAuthType(authType, value); |
| 1894 }, | 1895 }, |
| 1895 | 1896 |
| 1896 /** | 1897 /** |
| 1898 * Sets the state of touch view mode. | |
| 1899 * @param {boolean} isTouchViewEnabled true if the mode is on. | |
| 1900 */ | |
| 1901 setTouchViewState: function(isTouchViewEnabled) { | |
| 1902 this.touchViewEnabled_ = isTouchViewEnabled; | |
| 1903 }, | |
| 1904 | |
| 1905 /** | |
| 1897 * Shows a tooltip bubble explaining Easy Unlock for the focused pod. | 1906 * Shows a tooltip bubble explaining Easy Unlock for the focused pod. |
| 1898 */ | 1907 */ |
| 1899 showEasyUnlockBubble: function() { | 1908 showEasyUnlockBubble: function() { |
| 1900 if (!this.focusedPod_) { | 1909 if (!this.focusedPod_) { |
| 1901 console.error('No focused pod to show Easy Unlock bubble.'); | 1910 console.error('No focused pod to show Easy Unlock bubble.'); |
| 1902 return; | 1911 return; |
| 1903 } | 1912 } |
| 1904 | 1913 |
| 1905 var bubbleContent = document.createElement('div'); | 1914 var bubbleContent = document.createElement('div'); |
| 1906 bubbleContent.classList.add('easy-unlock-button-content'); | 1915 bubbleContent.classList.add('easy-unlock-button-content'); |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2534 if (pod && pod.multiProfilesPolicyApplied) { | 2543 if (pod && pod.multiProfilesPolicyApplied) { |
| 2535 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 2544 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 2536 } | 2545 } |
| 2537 } | 2546 } |
| 2538 }; | 2547 }; |
| 2539 | 2548 |
| 2540 return { | 2549 return { |
| 2541 PodRow: PodRow | 2550 PodRow: PodRow |
| 2542 }; | 2551 }; |
| 2543 }); | 2552 }); |
| OLD | NEW |