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

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

Issue 2875513002: Single user pod implementation for new login screen (Closed)
Patch Set: Created 3 years, 7 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
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 Account picker screen implementation. 6 * @fileoverview Account picker screen implementation.
7 */ 7 */
8 8
9 login.createScreen('AccountPickerScreen', 'account-picker', function() { 9 login.createScreen('AccountPickerScreen', 'account-picker', function() {
10 /** 10 /**
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 chrome.send('getTouchViewState'); 145 chrome.send('getTouchViewState');
146 if (!this.firstShown_) return; 146 if (!this.firstShown_) return;
147 this.firstShown_ = false; 147 this.firstShown_ = false;
148 148
149 // Ensure that login is actually visible. 149 // Ensure that login is actually visible.
150 window.requestAnimationFrame(function() { 150 window.requestAnimationFrame(function() {
151 chrome.send('accountPickerReady'); 151 chrome.send('accountPickerReady');
152 chrome.send('loginVisible', ['account-picker']); 152 chrome.send('loginVisible', ['account-picker']);
153 }); 153 });
154
155 // Add a dark background behind the page if material-design is enabled.
156 var shield = document.querySelector('#oobe-shield');
157 if (loadTimeData.getString('newOobeUI') == 'on')
jdufault 2017/05/10 00:40:07 I'm confused - this file should not be used in oob
Wenzhao (Colin) Zang 2017/05/11 18:13:36 Yes. I removed this part.
158 shield.setAttribute('md-mode', 'true');
159 else
160 shield.removeAttribute('md-mode');
154 }, 161 },
155 162
156 /** 163 /**
157 * Event handler that is invoked just before the frame is hidden. 164 * Event handler that is invoked just before the frame is hidden.
158 */ 165 */
159 onBeforeHide: function() { 166 onBeforeHide: function() {
160 $('pod-row').clearFocusedPod(); 167 $('pod-row').clearFocusedPod();
161 this.showing_ = false; 168 this.showing_ = false;
162 chrome.send('loginUIStateChanged', ['account-picker', false]); 169 chrome.send('loginUIStateChanged', ['account-picker', false]);
163 $('login-header-bar').signinUIState = SIGNIN_UI_STATE.HIDDEN; 170 $('login-header-bar').signinUIState = SIGNIN_UI_STATE.HIDDEN;
(...skipping 27 matching lines...) Expand all
191 // Update the pod row display if incorrect password. 198 // Update the pod row display if incorrect password.
192 $('pod-row').setFocusedPodErrorDisplay(true); 199 $('pod-row').setFocusedPodErrorDisplay(true);
193 200
194 /** @const */ var BUBBLE_OFFSET = 25; 201 /** @const */ var BUBBLE_OFFSET = 25;
195 // -8 = 4(BUBBLE_POD_OFFSET) - 2(bubble margin) 202 // -8 = 4(BUBBLE_POD_OFFSET) - 2(bubble margin)
196 // - 10(internal bubble adjustment) 203 // - 10(internal bubble adjustment)
197 var bubblePositioningPadding = -8; 204 var bubblePositioningPadding = -8;
198 205
199 var bubbleAnchor; 206 var bubbleAnchor;
200 var attachment; 207 var attachment;
201 if (activatedPod.pinContainer) { 208 // Anchor the bubble to the input field.
202 // Anchor the bubble to the input field. 209 bubbleAnchor =
203 bubbleAnchor = ( 210 (activatedPod.getElementsByClassName('auth-container'))[0];
jdufault 2017/05/10 00:40:07 remove extra ()
Wenzhao (Colin) Zang 2017/05/11 18:13:36 Done.
204 activatedPod.getElementsByClassName('auth-container'))[0]; 211 if (!bubbleAnchor) {
205 if (!bubbleAnchor) { 212 console.error('auth-container not found!');
206 console.error('auth-container not found!'); 213 bubbleAnchor = activatedPod.mainInput;
207 bubbleAnchor = activatedPod.mainInput; 214 }
208 } 215 if (activatedPod.pinContainer &&
216 activatedPod.pinContainer.style.visibility == 'visible')
209 attachment = cr.ui.Bubble.Attachment.RIGHT; 217 attachment = cr.ui.Bubble.Attachment.RIGHT;
210 } else { 218 else
211 // Anchor the bubble to the pod instead of the input.
212 bubbleAnchor = activatedPod;
213 attachment = cr.ui.Bubble.Attachment.BOTTOM; 219 attachment = cr.ui.Bubble.Attachment.BOTTOM;
214 }
215 220
216 var bubble = $('bubble'); 221 var bubble = $('bubble');
217 222
218 // Cannot use cr.ui.LoginUITools.get* on bubble until it is attached to 223 // Cannot use cr.ui.LoginUITools.get* on bubble until it is attached to
219 // the element. getMaxHeight/Width rely on the correct up/left element 224 // the element. getMaxHeight/Width rely on the correct up/left element
220 // side positioning that doesn't happen until bubble is attached. 225 // side positioning that doesn't happen until bubble is attached.
221 var maxHeight = 226 var maxHeight =
222 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping(bubbleAnchor) 227 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping(bubbleAnchor)
223 - bubbleAnchor.offsetHeight - BUBBLE_POD_OFFSET; 228 - bubbleAnchor.offsetHeight - BUBBLE_POD_OFFSET;
224 var maxWidth = cr.ui.LoginUITools.getMaxWidthToFit(bubbleAnchor) 229 var maxWidth = cr.ui.LoginUITools.getMaxWidthToFit(bubbleAnchor)
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 * @param {string} userID The user ID of the public session 472 * @param {string} userID The user ID of the public session
468 * @param {string} locale The locale to which this list of keyboard layouts 473 * @param {string} locale The locale to which this list of keyboard layouts
469 * applies 474 * applies
470 * @param {!Object} list List of available keyboard layouts 475 * @param {!Object} list List of available keyboard layouts
471 */ 476 */
472 setPublicSessionKeyboardLayouts: function(userID, locale, list) { 477 setPublicSessionKeyboardLayouts: function(userID, locale, list) {
473 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); 478 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list);
474 } 479 }
475 }; 480 };
476 }); 481 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698