Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 Login UI based on a stripped down OOBE controller. | 6 * @fileoverview Login UI based on a stripped down OOBE controller. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 <include src="login_shared.js"> | 9 <include src="login_shared.js"> |
| 10 | 10 |
| 11 // Asynchronously loads the pin keyboard. | 11 /** |
| 12 function showPinKeyboardAsync() { | 12 * Asynchronously loads the pin keyboard. |
| 13 */ | |
| 14 function loadPinKeyboardAsync() { | |
| 13 'use strict'; | 15 'use strict'; |
| 14 | 16 |
| 15 // This function could get called multiple times. Do nothing if we have | 17 // This function could get called multiple times. Do nothing if we have |
| 16 // already loaded. This check needs to happen before the registerAssets call, | 18 // already loaded. This check needs to happen before the registerAssets call, |
| 17 // because that will clobber the loaded state. | 19 // because that will clobber the loaded state. |
| 18 if (cr.ui.login.ResourceLoader.alreadyLoadedAssets('custom-elements')) | 20 if (cr.ui.login.ResourceLoader.alreadyLoadedAssets('custom-elements')) |
| 19 return; | 21 return; |
| 20 | 22 |
| 21 // Register loader for custom elements. | 23 // Register loader for custom elements. |
| 22 cr.ui.login.ResourceLoader.registerAssets({ | 24 cr.ui.login.ResourceLoader.registerAssets({ |
| 23 id: 'custom-elements', | 25 id: 'custom-elements', |
| 24 html: [{ url: 'chrome://oobe/custom_elements.html' }] | 26 html: [{ url: 'chrome://oobe/custom_elements.html' }] |
| 25 }); | 27 }); |
| 26 | 28 |
| 27 // Called after polymer has been loaded. Fades the pin element in. | 29 // Called after polymer has been loaded. Fades the pin element in. |
| 28 var onPinLoaded = function(pinContainer) { | 30 var onPinLoaded = function() { |
| 29 pinContainer.style.opacity = 1; | 31 var podrow = $('pod-row'); |
|
jdufault
2016/06/23 00:02:31
nit: podRow
sammiequon
2016/06/23 19:23:21
Done.
| |
| 32 podrow.setFocusedPodPinVisibility(true); | |
|
jdufault
2016/06/23 00:02:31
What's the plan for this callback? Right now it is
sammiequon
2016/06/23 19:23:21
Done.
| |
| 30 }; | 33 }; |
| 31 | 34 |
| 32 // We only load the PIN element when it is actually shown so that lock screen | 35 // We only load the PIN element when it is actually shown so that lock screen |
| 33 // load times remain low when the user is not using a PIN. | 36 // load times remain low when the user is not using a PIN. |
| 34 // | 37 // |
| 35 // Loading the PIN element blocks the DOM, which will interrupt any running | 38 // Loading the PIN element blocks the DOM, which will interrupt any running |
| 36 // animations. We load the PIN after an idle notification to allow the pod | 39 // animations. We load the PIN after an idle notification to allow the pod |
| 37 // fly-in animation to complete without interruption. | 40 // fly-in animation to complete without interruption. |
| 38 cr.ui.login.ResourceLoader.loadAssetsOnIdle('custom-elements', function() { | 41 cr.ui.login.ResourceLoader.loadAssetsOnIdle('custom-elements', function() { |
| 39 cr.ui.login.ResourceLoader.waitUntilLayoutComplete('pin-container', | 42 cr.ui.login.ResourceLoader.waitUntilLayoutComplete('pin-container', |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 * Reloads content of the page. | 75 * Reloads content of the page. |
| 73 * @param {!Object} data New dictionary with i18n values. | 76 * @param {!Object} data New dictionary with i18n values. |
| 74 */ | 77 */ |
| 75 reloadContent: function(data) { | 78 reloadContent: function(data) { |
| 76 loadTimeData.overrideValues(data); | 79 loadTimeData.overrideValues(data); |
| 77 i18nTemplate.process(document, loadTimeData); | 80 i18nTemplate.process(document, loadTimeData); |
| 78 Oobe.getInstance().updateLocalizedContent_(); | 81 Oobe.getInstance().updateLocalizedContent_(); |
| 79 }, | 82 }, |
| 80 }; | 83 }; |
| 81 }); | 84 }); |
| OLD | NEW |