| 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 |
| 2100 var monitoringDialog = this.querySelector('.monitoring-dialog'); |
| 2101 monitoringDialog.addEventListener( |
| 2102 'iron-overlay-closed', |
| 2103 this.onMonitoringDialogOverlayClosed_.bind(this)); |
| 2104 |
| 2095 this.enterButtonElement.addEventListener('click', (function(e) { | 2105 this.enterButtonElement.addEventListener('click', (function(e) { |
| 2096 this.enterButtonElement.disabled = true; | 2106 this.enterButtonElement.disabled = true; |
| 2097 var locale = this.querySelector('.language-select').value; | 2107 var locale = this.querySelector('.language-select').value; |
| 2098 var keyboardSelect = this.querySelector('.keyboard-select'); | 2108 var keyboardSelect = this.querySelector('.keyboard-select'); |
| 2099 // The contents of |keyboardSelect| is updated asynchronously. If its | 2109 // The contents of |keyboardSelect| is updated asynchronously. If its |
| 2100 // locale does not match |locale|, it has not updated yet and the | 2110 // locale does not match |locale|, it has not updated yet and the |
| 2101 // currently selected keyboard layout may not be applicable to |locale|. | 2111 // currently selected keyboard layout may not be applicable to |locale|. |
| 2102 // Do not return any keyboard layout in this case and let the backend | 2112 // Do not return any keyboard layout in this case and let the backend |
| 2103 // choose a suitable layout. | 2113 // choose a suitable layout. |
| 2104 var keyboardLayout = | 2114 var keyboardLayout = |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2236 observer); | 2246 observer); |
| 2237 pod.classList.remove('transitioning-to-advanced'); | 2247 pod.classList.remove('transitioning-to-advanced'); |
| 2238 pod.querySelector('.language-select').focus(); | 2248 pod.querySelector('.language-select').focus(); |
| 2239 }); | 2249 }); |
| 2240 // Guard timer set to animation duration + 20ms. | 2250 // Guard timer set to animation duration + 20ms. |
| 2241 ensureTransitionEndEvent(languageAndInputSection, 380); | 2251 ensureTransitionEndEvent(languageAndInputSection, 380); |
| 2242 }, 0); | 2252 }, 0); |
| 2243 }, | 2253 }, |
| 2244 | 2254 |
| 2245 /** | 2255 /** |
| 2256 * Show a dialog when user clicks on learn more (monitoring) button. |
| 2257 */ |
| 2258 onMonitoringLearnMoreClicked_: function() { |
| 2259 monitoringDialog = this.querySelector('.monitoring-dialog'); |
| 2260 monitoringDialog.fitInto = this; |
| 2261 monitoringDialog.open(); |
| 2262 monitoringDialog.focus(); |
| 2263 this.querySelector('.monitoring-overlay').hidden = false; |
| 2264 |
| 2265 }, |
| 2266 |
| 2267 /** |
| 2268 * Cleanup after the (monitoring) dialog overlay is closed. |
| 2269 */ |
| 2270 onMonitoringDialogOverlayClosed_: function() { |
| 2271 this.querySelector('.monitoring-overlay').hidden = true; |
| 2272 }, |
| 2273 |
| 2274 /** |
| 2246 * Retrieves the list of keyboard layouts available for the currently | 2275 * Retrieves the list of keyboard layouts available for the currently |
| 2247 * selected locale. | 2276 * selected locale. |
| 2248 */ | 2277 */ |
| 2249 getPublicSessionKeyboardLayouts_: function() { | 2278 getPublicSessionKeyboardLayouts_: function() { |
| 2250 var selectedLocale = this.querySelector('.language-select').value; | 2279 var selectedLocale = this.querySelector('.language-select').value; |
| 2251 if (selectedLocale == | 2280 if (selectedLocale == |
| 2252 this.querySelector('.keyboard-select').loadedLocale) { | 2281 this.querySelector('.keyboard-select').loadedLocale) { |
| 2253 // If the list of keyboard layouts was loaded for the currently selected | 2282 // If the list of keyboard layouts was loaded for the currently selected |
| 2254 // locale, it is already up to date. | 2283 // locale, it is already up to date. |
| 2255 return; | 2284 return; |
| (...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3681 if (pod && pod.multiProfilesPolicyApplied) { | 3710 if (pod && pod.multiProfilesPolicyApplied) { |
| 3682 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 3711 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 3683 } | 3712 } |
| 3684 } | 3713 } |
| 3685 }; | 3714 }; |
| 3686 | 3715 |
| 3687 return { | 3716 return { |
| 3688 PodRow: PodRow | 3717 PodRow: PodRow |
| 3689 }; | 3718 }; |
| 3690 }); | 3719 }); |
| OLD | NEW |