Chromium Code Reviews| Index: chrome/browser/resources/chromeos/login/lock.js |
| diff --git a/chrome/browser/resources/chromeos/login/lock.js b/chrome/browser/resources/chromeos/login/lock.js |
| index 9800faec319595ee3dc148d52b6662c405682dd0..c3a6a22674a591b1c2bc213cb62bac6cb7d88cf2 100644 |
| --- a/chrome/browser/resources/chromeos/login/lock.js |
| +++ b/chrome/browser/resources/chromeos/login/lock.js |
| @@ -8,6 +8,35 @@ |
| <include src="login_shared.js"> |
| +// Lazy load polymer. |
| +(function() { |
| + 'use strict'; |
| + |
| + // Register loader for custom elements. |
| + cr.ui.login.ResourceLoader.registerAssets({ |
| + id: 'custom-elements', |
| + html: [{ url: 'chrome://oobe/custom_elements.html' }] |
| + }); |
| + |
| + // Called after polymer has been loaded. Fades the pin element in. |
| + var onPolymerLoaded = function() { |
| + var pinContainer = $('pin-container'); |
| + pinContainer.style.opacity = 1; |
| + }; |
| + |
| + // We only load the PIN element when it is actually shown so that lock screen |
| + // load times remain low when the user is not using a PIN. |
| + // |
| + // Loading the PIN element blocks the DOM, which will interrupt any running |
| + // animations. We load the PIN after an idle notification to allow the pod |
| + // fly-in animation to complete without interruption. |
| + var showPin = loadTimeData.getBoolean('showPin'); |
| + if (showPin) { |
|
tommycli
2016/05/06 23:54:18
nit: just inline the getBoolean into here
jdufault
2016/05/10 18:45:23
Done.
|
| + cr.ui.login.ResourceLoader.loadAssetsOnIdle('custom-elements', |
| + onPolymerLoaded); |
| + } |
| +})(); |
| + |
| cr.define('cr.ui.Oobe', function() { |
| return { |
| /** |