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 // 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 var showPin = loadTimeData.getBoolean('showPin'); | |
| 34 if (showPin) { | |
|
tommycli
2016/05/06 23:54:18
nit: just inline the getBoolean into here
jdufault
2016/05/10 18:45:23
Done.
| |
| 35 cr.ui.login.ResourceLoader.loadAssetsOnIdle('custom-elements', | |
| 36 onPolymerLoaded); | |
| 37 } | |
| 38 })(); | |
| 39 | |
| 11 cr.define('cr.ui.Oobe', function() { | 40 cr.define('cr.ui.Oobe', function() { |
| 12 return { | 41 return { |
| 13 /** | 42 /** |
| 14 * Initializes the OOBE flow. This will cause all C++ handlers to | 43 * Initializes the OOBE flow. This will cause all C++ handlers to |
| 15 * be invoked to do final setup. | 44 * be invoked to do final setup. |
| 16 */ | 45 */ |
| 17 initialize: function() { | 46 initialize: function() { |
| 18 // TODO(jdufault): Remove this after resolving crbug.com/452599. | 47 // TODO(jdufault): Remove this after resolving crbug.com/452599. |
| 19 console.log('Start initializing LOCK OOBE'); | 48 console.log('Start initializing LOCK OOBE'); |
| 20 | 49 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 42 * Reloads content of the page. | 71 * Reloads content of the page. |
| 43 * @param {!Object} data New dictionary with i18n values. | 72 * @param {!Object} data New dictionary with i18n values. |
| 44 */ | 73 */ |
| 45 reloadContent: function(data) { | 74 reloadContent: function(data) { |
| 46 loadTimeData.overrideValues(data); | 75 loadTimeData.overrideValues(data); |
| 47 i18nTemplate.process(document, loadTimeData); | 76 i18nTemplate.process(document, loadTimeData); |
| 48 Oobe.getInstance().updateLocalizedContent_(); | 77 Oobe.getInstance().updateLocalizedContent_(); |
| 49 }, | 78 }, |
| 50 }; | 79 }; |
| 51 }); | 80 }); |
| OLD | NEW |