| 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 // Lazy load polymer. |
| 12 (function() { |
| 13 'use strict'; |
| 14 |
| 15 // Register loader for custom elements. |
| 16 cr.ui.login.ResourceLoader.registerAssets({ |
| 17 id: 'custom-elements', |
| 18 html: [{ url: 'chrome://oobe/custom_elements.html' }] |
| 19 }); |
| 20 |
| 21 // Called after polymer has been loaded. Fades the pin element in. |
| 22 var onPolymerLoaded = function() { |
| 23 var pinContainer = $('pin-container'); |
| 24 pinContainer.style.opacity = 1; |
| 25 }; |
| 26 |
| 27 // We only load the PIN element when it is actually shown so that lock screen |
| 28 // load times remain low when the user is not using a PIN. |
| 29 // |
| 30 // Loading the PIN element blocks the DOM, which will interrupt any running |
| 31 // animations. We load the PIN after an idle notification to allow the pod |
| 32 // fly-in animation to complete without interruption. |
| 33 if (loadTimeData.getBoolean('showPin')) { |
| 34 cr.ui.login.ResourceLoader.loadAssetsOnIdle('custom-elements', |
| 35 onPolymerLoaded); |
| 36 } |
| 37 })(); |
| 38 |
| 11 cr.define('cr.ui.Oobe', function() { | 39 cr.define('cr.ui.Oobe', function() { |
| 12 return { | 40 return { |
| 13 /** | 41 /** |
| 14 * Initializes the OOBE flow. This will cause all C++ handlers to | 42 * Initializes the OOBE flow. This will cause all C++ handlers to |
| 15 * be invoked to do final setup. | 43 * be invoked to do final setup. |
| 16 */ | 44 */ |
| 17 initialize: function() { | 45 initialize: function() { |
| 18 // TODO(jdufault): Remove this after resolving crbug.com/452599. | 46 // TODO(jdufault): Remove this after resolving crbug.com/452599. |
| 19 console.log('Start initializing LOCK OOBE'); | 47 console.log('Start initializing LOCK OOBE'); |
| 20 | 48 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 42 * Reloads content of the page. | 70 * Reloads content of the page. |
| 43 * @param {!Object} data New dictionary with i18n values. | 71 * @param {!Object} data New dictionary with i18n values. |
| 44 */ | 72 */ |
| 45 reloadContent: function(data) { | 73 reloadContent: function(data) { |
| 46 loadTimeData.overrideValues(data); | 74 loadTimeData.overrideValues(data); |
| 47 i18nTemplate.process(document, loadTimeData); | 75 i18nTemplate.process(document, loadTimeData); |
| 48 Oobe.getInstance().updateLocalizedContent_(); | 76 Oobe.getInstance().updateLocalizedContent_(); |
| 49 }, | 77 }, |
| 50 }; | 78 }; |
| 51 }); | 79 }); |
| OLD | NEW |