OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 Common OOBE controller methods. | 6 * @fileoverview Common OOBE controller methods. |
7 */ | 7 */ |
8 | 8 |
9 <include src="../../../../../ui/login/screen.js"> | 9 <include src="../../../../../ui/login/screen.js"> |
10 <include src="screen_context.js"> | 10 <include src="screen_context.js"> |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 }); | 346 }); |
347 | 347 |
348 // Register assets for async loading. | 348 // Register assets for async loading. |
349 [{ | 349 [{ |
350 id: SCREEN_OOBE_ENROLLMENT, | 350 id: SCREEN_OOBE_ENROLLMENT, |
351 html: [{ url: 'chrome://oobe/enrollment.html', targetID: 'inner-container' }], | 351 html: [{ url: 'chrome://oobe/enrollment.html', targetID: 'inner-container' }], |
352 css: ['chrome://oobe/enrollment.css'], | 352 css: ['chrome://oobe/enrollment.css'], |
353 js: ['chrome://oobe/enrollment.js'] | 353 js: ['chrome://oobe/enrollment.js'] |
354 }].forEach(cr.ui.login.ResourceLoader.registerAssets); | 354 }].forEach(cr.ui.login.ResourceLoader.registerAssets); |
355 | 355 |
356 document.addEventListener('DOMContentLoaded', function() { | 356 (function() { |
357 'use strict'; | 357 'use strict'; |
358 | 358 |
359 // Immediately load async assets. | 359 function initializeOobe() { |
360 // TODO(dconnelly): remove this at some point and only load as needed. | 360 // Immediately load async assets. |
361 // See crbug.com/236426 | 361 // TODO(dconnelly): remove this at some point and only load as needed. |
362 cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() { | 362 // See crbug.com/236426 |
363 // This screen is async-loaded so we manually trigger i18n processing. | 363 cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() { |
364 i18nTemplate.process($('oauth-enrollment'), loadTimeData); | 364 // This screen is async-loaded so we manually trigger i18n processing. |
365 // Delayed binding since this isn't defined yet. | 365 i18nTemplate.process($('oauth-enrollment'), loadTimeData); |
366 login.OAuthEnrollmentScreen.register(); | 366 // Delayed binding since this isn't defined yet. |
| 367 login.OAuthEnrollmentScreen.register(); |
| 368 }); |
| 369 |
| 370 cr.ui.Oobe.initialize(); |
| 371 } |
| 372 |
| 373 document.addEventListener('DOMContentLoaded', function() { |
| 374 if (!window['WAIT_FOR_POLYMER']) { |
| 375 initializeOobe(); |
| 376 return; |
| 377 } |
| 378 window.addEventListener('polymer-ready', function() { |
| 379 initializeOobe(); |
| 380 }); |
367 }); | 381 }); |
368 | 382 })(); |
369 // Delayed binding since this isn't defined yet. | |
370 cr.ui.Oobe.initialize(); | |
371 }); | |
OLD | NEW |