| Index: chrome/browser/resources/chromeos/login/login_common.js
|
| diff --git a/chrome/browser/resources/chromeos/login/login_common.js b/chrome/browser/resources/chromeos/login/login_common.js
|
| index cc67aa4de28415688990458bc4d869555cd1f85e..612deac48c8c5a51120ef0475106e4f8491c8e05 100644
|
| --- a/chrome/browser/resources/chromeos/login/login_common.js
|
| +++ b/chrome/browser/resources/chromeos/login/login_common.js
|
| @@ -353,19 +353,30 @@ disableTextSelectAndDrag(function(e) {
|
| js: ['chrome://oobe/enrollment.js']
|
| }].forEach(cr.ui.login.ResourceLoader.registerAssets);
|
|
|
| -document.addEventListener('DOMContentLoaded', function() {
|
| +(function() {
|
| 'use strict';
|
|
|
| - // Immediately load async assets.
|
| - // TODO(dconnelly): remove this at some point and only load as needed.
|
| - // See crbug.com/236426
|
| - cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() {
|
| - // This screen is async-loaded so we manually trigger i18n processing.
|
| - i18nTemplate.process($('oauth-enrollment'), loadTimeData);
|
| - // Delayed binding since this isn't defined yet.
|
| - login.OAuthEnrollmentScreen.register();
|
| - });
|
| + function initializeOobe() {
|
| + // Immediately load async assets.
|
| + // TODO(dconnelly): remove this at some point and only load as needed.
|
| + // See crbug.com/236426
|
| + cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() {
|
| + // This screen is async-loaded so we manually trigger i18n processing.
|
| + i18nTemplate.process($('oauth-enrollment'), loadTimeData);
|
| + // Delayed binding since this isn't defined yet.
|
| + login.OAuthEnrollmentScreen.register();
|
| + });
|
|
|
| - // Delayed binding since this isn't defined yet.
|
| - cr.ui.Oobe.initialize();
|
| -});
|
| + cr.ui.Oobe.initialize();
|
| + }
|
| +
|
| + document.addEventListener('DOMContentLoaded', function() {
|
| + if (!WAIT_FOR_POLYMER) {
|
| + initializeOobe();
|
| + return;
|
| + }
|
| + window.addEventListener('polymer-ready', function() {
|
| + initializeOobe();
|
| + });
|
| + });
|
| +})();
|
|
|