| 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 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 if (!this.dialogContainer_) { |
| 2255 this.dialogContainer_ = document.createElement('div'); |
| 2256 this.dialogContainer_.classList.add('monitoring-dialog-container'); |
| 2257 var topContainer = document.querySelector('#scroll-container'); |
| 2258 topContainer.appendChild(this.dialogContainer_); |
| 2259 } |
| 2260 // Public Session POD in advanced view has a different size so add a dummy |
| 2261 // parent element to enable different CSS settings. |
| 2262 this.dialogContainer_.classList.toggle( |
| 2263 'advanced', this.classList.contains('advanced')) |
| 2264 var html = ''; |
| 2265 var infoItems = ['publicAccountMonitoringInfoItem1', |
| 2266 'publicAccountMonitoringInfoItem2', |
| 2267 'publicAccountMonitoringInfoItem3', |
| 2268 'publicAccountMonitoringInfoItem4']; |
| 2269 for (item of infoItems) { |
| 2270 html += '<p class="cr-dialog-item">'; |
| 2271 html += loadTimeData.getString(item); |
| 2272 html += '</p>'; |
| 2273 } |
| 2274 var title = loadTimeData.getString('publicAccountMonitoringInfo'); |
| 2275 this.dialog_ = new cr.ui.dialogs.BaseDialog(this.dialogContainer_); |
| 2276 this.dialog_.showHtml(title, html, undefined, |
| 2277 this.onMonitoringDialogClosed_.bind(this)); |
| 2278 this.parentNode.disabled = true; |
| 2279 }, |
| 2280 |
| 2281 /** |
| 2282 * Cleanup after the monitoring warning dialog is closed. |
| 2283 */ |
| 2284 onMonitoringDialogClosed_: function() { |
| 2285 this.parentNode.disabled = false; |
| 2286 this.dialog_ = undefined; |
| 2287 }, |
| 2288 |
| 2289 /** |
| 2246 * Retrieves the list of keyboard layouts available for the currently | 2290 * Retrieves the list of keyboard layouts available for the currently |
| 2247 * selected locale. | 2291 * selected locale. |
| 2248 */ | 2292 */ |
| 2249 getPublicSessionKeyboardLayouts_: function() { | 2293 getPublicSessionKeyboardLayouts_: function() { |
| 2250 var selectedLocale = this.querySelector('.language-select').value; | 2294 var selectedLocale = this.querySelector('.language-select').value; |
| 2251 if (selectedLocale == | 2295 if (selectedLocale == |
| 2252 this.querySelector('.keyboard-select').loadedLocale) { | 2296 this.querySelector('.keyboard-select').loadedLocale) { |
| 2253 // If the list of keyboard layouts was loaded for the currently selected | 2297 // If the list of keyboard layouts was loaded for the currently selected |
| 2254 // locale, it is already up to date. | 2298 // locale, it is already up to date. |
| 2255 return; | 2299 return; |
| (...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3681 if (pod && pod.multiProfilesPolicyApplied) { | 3725 if (pod && pod.multiProfilesPolicyApplied) { |
| 3682 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 3726 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 3683 } | 3727 } |
| 3684 } | 3728 } |
| 3685 }; | 3729 }; |
| 3686 | 3730 |
| 3687 return { | 3731 return { |
| 3688 PodRow: PodRow | 3732 PodRow: PodRow |
| 3689 }; | 3733 }; |
| 3690 }); | 3734 }); |
| OLD | NEW |