Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: ui/login/account_picker/user_pod_row.js

Issue 978273002: Make user pod menu always visible in touchview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment fixed Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/login/account_picker/user_pod_row.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after
2131 2131
2132 // Array of apps that are shown in addition to other user pods. 2132 // Array of apps that are shown in addition to other user pods.
2133 apps_: [], 2133 apps_: [],
2134 2134
2135 // True to show app pods along with user pods. 2135 // True to show app pods along with user pods.
2136 shouldShowApps_: true, 2136 shouldShowApps_: true,
2137 2137
2138 // Array of users that are shown (public/supervised/regular). 2138 // Array of users that are shown (public/supervised/regular).
2139 users_: [], 2139 users_: [],
2140 2140
2141 // If we're disabling single pod autofocus for Touch View. 2141 // If we're in Touch View mode.
2142 touchViewSinglePodExperimentOn_: true, 2142 touchViewEnabled_: false,
2143
2144 2143
2145 /** @override */ 2144 /** @override */
2146 decorate: function() { 2145 decorate: function() {
2147 // Event listeners that are installed for the time period during which 2146 // Event listeners that are installed for the time period during which
2148 // the element is visible. 2147 // the element is visible.
2149 this.listeners_ = { 2148 this.listeners_ = {
2150 focus: [this.handleFocus_.bind(this), true /* useCapture */], 2149 focus: [this.handleFocus_.bind(this), true /* useCapture */],
2151 click: [this.handleClick_.bind(this), true], 2150 click: [this.handleClick_.bind(this), true],
2152 mousemove: [this.handleMouseMove_.bind(this), false], 2151 mousemove: [this.handleMouseMove_.bind(this), false],
2153 keydown: [this.handleKeyDown.bind(this), false] 2152 keydown: [this.handleKeyDown.bind(this), false]
(...skipping 17 matching lines...) Expand all
2171 2170
2172 /** 2171 /**
2173 * Return true if user pod row has only single user pod in it, which should 2172 * Return true if user pod row has only single user pod in it, which should
2174 * always be focused except desktop and touch view modes. 2173 * always be focused except desktop and touch view modes.
2175 * @type {boolean} 2174 * @type {boolean}
2176 */ 2175 */
2177 get alwaysFocusSinglePod() { 2176 get alwaysFocusSinglePod() {
2178 var isDesktopUserManager = Oobe.getInstance().displayType == 2177 var isDesktopUserManager = Oobe.getInstance().displayType ==
2179 DISPLAY_TYPE.DESKTOP_USER_MANAGER; 2178 DISPLAY_TYPE.DESKTOP_USER_MANAGER;
2180 2179
2181 return (isDesktopUserManager || 2180 return (isDesktopUserManager || this.touchViewEnabled_) ?
2182 (this.touchViewSinglePodExperimentOn_ &&
2183 this.touchViewEnabled_)) ?
2184 false : this.children.length == 1; 2181 false : this.children.length == 1;
2185 }, 2182 },
2186 2183
2187 /** 2184 /**
2188 * Returns pod with the given app id. 2185 * Returns pod with the given app id.
2189 * @param {!string} app_id Application id to be matched. 2186 * @param {!string} app_id Application id to be matched.
2190 * @return {Object} Pod with the given app id. null if pod hasn't been 2187 * @return {Object} Pod with the given app id. null if pod hasn't been
2191 * found. 2188 * found.
2192 */ 2189 */
2193 getPodWithAppId_: function(app_id) { 2190 getPodWithAppId_: function(app_id) {
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
2525 } 2522 }
2526 pod.setAuthType(authType, value); 2523 pod.setAuthType(authType, value);
2527 }, 2524 },
2528 2525
2529 /** 2526 /**
2530 * Sets the state of touch view mode. 2527 * Sets the state of touch view mode.
2531 * @param {boolean} isTouchViewEnabled true if the mode is on. 2528 * @param {boolean} isTouchViewEnabled true if the mode is on.
2532 */ 2529 */
2533 setTouchViewState: function(isTouchViewEnabled) { 2530 setTouchViewState: function(isTouchViewEnabled) {
2534 this.touchViewEnabled_ = isTouchViewEnabled; 2531 this.touchViewEnabled_ = isTouchViewEnabled;
2532 this.pods.forEach(function(pod, index) {
2533 pod.actionBoxAreaElement.classList.toggle('forced', isTouchViewEnabled);
2534 });
2535 }, 2535 },
2536 2536
2537 /** 2537 /**
2538 * Updates the display name shown on a public session pod. 2538 * Updates the display name shown on a public session pod.
2539 * @param {string} userID The user ID of the public session 2539 * @param {string} userID The user ID of the public session
2540 * @param {string} displayName The new display name 2540 * @param {string} displayName The new display name
2541 */ 2541 */
2542 setPublicSessionDisplayName: function(userID, displayName) { 2542 setPublicSessionDisplayName: function(userID, displayName) {
2543 var pod = this.getPodWithUsername_(userID); 2543 var pod = this.getPodWithUsername_(userID);
2544 if (pod != null) 2544 if (pod != null)
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
3151 if (pod && pod.multiProfilesPolicyApplied) { 3151 if (pod && pod.multiProfilesPolicyApplied) {
3152 pod.userTypeBubbleElement.classList.remove('bubble-shown'); 3152 pod.userTypeBubbleElement.classList.remove('bubble-shown');
3153 } 3153 }
3154 } 3154 }
3155 }; 3155 };
3156 3156
3157 return { 3157 return {
3158 PodRow: PodRow 3158 PodRow: PodRow
3159 }; 3159 };
3160 }); 3160 });
OLDNEW
« no previous file with comments | « ui/login/account_picker/user_pod_row.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698