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

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

Issue 2516903002: PS - Adjusting Public Session login pod for expanded whitelisting (Closed)
Patch Set: Fixed alpha sort Created 4 years 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 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 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after
2085 2085
2086 var keyboardSelect = this.querySelector('.keyboard-select'); 2086 var keyboardSelect = this.querySelector('.keyboard-select');
2087 keyboardSelect.tabIndex = UserPodTabOrder.POD_INPUT; 2087 keyboardSelect.tabIndex = UserPodTabOrder.POD_INPUT;
2088 keyboardSelect.loadedLocale = null; 2088 keyboardSelect.loadedLocale = null;
2089 2089
2090 var languageAndInput = this.querySelector('.language-and-input'); 2090 var languageAndInput = this.querySelector('.language-and-input');
2091 languageAndInput.tabIndex = UserPodTabOrder.POD_INPUT; 2091 languageAndInput.tabIndex = UserPodTabOrder.POD_INPUT;
2092 languageAndInput.addEventListener('click', 2092 languageAndInput.addEventListener('click',
2093 this.transitionToAdvanced_.bind(this)); 2093 this.transitionToAdvanced_.bind(this));
2094 2094
2095 var monitoringLearnMore = this.querySelector('.monitoring-learn-more');
2096 monitoringLearnMore.tabIndex = UserPodTabOrder.POD_INPUT;
2097 monitoringLearnMore.addEventListener(
2098 'click', this.onMonitoringLearnMoreClicked_.bind(this));
2099
2095 this.enterButtonElement.addEventListener('click', (function(e) { 2100 this.enterButtonElement.addEventListener('click', (function(e) {
2096 this.enterButtonElement.disabled = true; 2101 this.enterButtonElement.disabled = true;
2097 var locale = this.querySelector('.language-select').value; 2102 var locale = this.querySelector('.language-select').value;
2098 var keyboardSelect = this.querySelector('.keyboard-select'); 2103 var keyboardSelect = this.querySelector('.keyboard-select');
2099 // The contents of |keyboardSelect| is updated asynchronously. If its 2104 // The contents of |keyboardSelect| is updated asynchronously. If its
2100 // locale does not match |locale|, it has not updated yet and the 2105 // locale does not match |locale|, it has not updated yet and the
2101 // currently selected keyboard layout may not be applicable to |locale|. 2106 // currently selected keyboard layout may not be applicable to |locale|.
2102 // Do not return any keyboard layout in this case and let the backend 2107 // Do not return any keyboard layout in this case and let the backend
2103 // choose a suitable layout. 2108 // choose a suitable layout.
2104 var keyboardLayout = 2109 var keyboardLayout =
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2236 observer); 2241 observer);
2237 pod.classList.remove('transitioning-to-advanced'); 2242 pod.classList.remove('transitioning-to-advanced');
2238 pod.querySelector('.language-select').focus(); 2243 pod.querySelector('.language-select').focus();
2239 }); 2244 });
2240 // Guard timer set to animation duration + 20ms. 2245 // Guard timer set to animation duration + 20ms.
2241 ensureTransitionEndEvent(languageAndInputSection, 380); 2246 ensureTransitionEndEvent(languageAndInputSection, 380);
2242 }, 0); 2247 }, 0);
2243 }, 2248 },
2244 2249
2245 /** 2250 /**
2251 * Show a dialog when user clicks on learn more (monitoring) button.
2252 */
2253 onMonitoringLearnMoreClicked_: function() {
2254 var dialogParent = document.querySelector('#scroll-container');
2255 // Public Session POD in advanced view has a different size so add a dummy
2256 // parent element to enable different CSS settings.
2257 if (this.classList.contains('advanced')) {
2258 var div = document.createElement('div');
2259 div.className = 'cr-dialog-advanced';
2260 dialogParent.appendChild(div);
2261 dialogParent = div;
2262 }
2263 var html = '';
2264 var infoItems = ['publicAccountMonitoringInfoItem1',
2265 'publicAccountMonitoringInfoItem2',
2266 'publicAccountMonitoringInfoItem3',
2267 'publicAccountMonitoringInfoItem4'];
2268 for (item of infoItems) {
2269 html += '<p class="cr-dialog-item">';
2270 html += loadTimeData.getString(item);
2271 html += '</p>';
2272 }
2273 var title = loadTimeData.getString('publicAccountMonitoringInfo');
2274 this.dialog_ = new cr.ui.dialogs.BaseDialog(dialogParent);
2275 this.dialog_.showHtml(title, html, undefined,
2276 this.onMonitoringDialogClosed_.bind(this));
2277 document.querySelector('#pod-row').disabled = true;
2278 },
2279
2280 /**
2281 * Cleanup after the monitoring warning dialog is closed.
2282 */
2283 onMonitoringDialogClosed_: function() {
2284 document.querySelector('#pod-row').disabled = false;
2285 this.dialog_ = undefined;
2286 },
2287
2288 /**
2246 * Retrieves the list of keyboard layouts available for the currently 2289 * Retrieves the list of keyboard layouts available for the currently
2247 * selected locale. 2290 * selected locale.
2248 */ 2291 */
2249 getPublicSessionKeyboardLayouts_: function() { 2292 getPublicSessionKeyboardLayouts_: function() {
2250 var selectedLocale = this.querySelector('.language-select').value; 2293 var selectedLocale = this.querySelector('.language-select').value;
2251 if (selectedLocale == 2294 if (selectedLocale ==
2252 this.querySelector('.keyboard-select').loadedLocale) { 2295 this.querySelector('.keyboard-select').loadedLocale) {
2253 // If the list of keyboard layouts was loaded for the currently selected 2296 // If the list of keyboard layouts was loaded for the currently selected
2254 // locale, it is already up to date. 2297 // locale, it is already up to date.
2255 return; 2298 return;
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after
3681 if (pod && pod.multiProfilesPolicyApplied) { 3724 if (pod && pod.multiProfilesPolicyApplied) {
3682 pod.userTypeBubbleElement.classList.remove('bubble-shown'); 3725 pod.userTypeBubbleElement.classList.remove('bubble-shown');
3683 } 3726 }
3684 } 3727 }
3685 }; 3728 };
3686 3729
3687 return { 3730 return {
3688 PodRow: PodRow 3731 PodRow: PodRow
3689 }; 3732 };
3690 }); 3733 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698