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="test_util.js"> | 9 <include src="test_util.js"> |
10 <include src="../../../../../ui/login/screen.js"> | 10 <include src="../../../../../ui/login/screen.js"> |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 [{ | 397 [{ |
398 id: SCREEN_OOBE_ENROLLMENT, | 398 id: SCREEN_OOBE_ENROLLMENT, |
399 html: [{ url: 'chrome://oobe/enrollment.html', targetID: 'inner-container' }], | 399 html: [{ url: 'chrome://oobe/enrollment.html', targetID: 'inner-container' }], |
400 css: ['chrome://oobe/enrollment.css'], | 400 css: ['chrome://oobe/enrollment.css'], |
401 js: ['chrome://oobe/enrollment.js'] | 401 js: ['chrome://oobe/enrollment.js'] |
402 }].forEach(cr.ui.login.ResourceLoader.registerAssets); | 402 }].forEach(cr.ui.login.ResourceLoader.registerAssets); |
403 | 403 |
404 (function() { | 404 (function() { |
405 'use strict'; | 405 'use strict'; |
406 | 406 |
407 function initializeOobe() { | 407 document.addEventListener('DOMContentLoaded', function() { |
408 // Immediately load async assets. | 408 // Immediately load async assets. |
409 // TODO(dconnelly): remove this at some point and only load as needed. | 409 // TODO(dconnelly): remove this at some point and only load as needed. |
410 // See crbug.com/236426 | 410 // See crbug.com/236426 |
411 cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() { | 411 cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() { |
412 // This screen is async-loaded so we manually trigger i18n processing. | 412 // This screen is async-loaded so we manually trigger i18n processing. |
413 i18nTemplate.process($('oauth-enrollment'), loadTimeData); | 413 i18nTemplate.process($('oauth-enrollment'), loadTimeData); |
414 // Delayed binding since this isn't defined yet. | 414 // Delayed binding since this isn't defined yet. |
415 login.OAuthEnrollmentScreen.register(); | 415 login.OAuthEnrollmentScreen.register(); |
416 }); | 416 }); |
417 | 417 |
418 cr.ui.Oobe.initialize(); | 418 cr.ui.Oobe.initialize(); |
419 } | |
420 | |
421 document.addEventListener('DOMContentLoaded', function() { | |
422 if (!window['WAIT_FOR_POLYMER']) { | |
423 initializeOobe(); | |
424 return; | |
425 } | |
426 window.addEventListener('polymer-ready', function() { | |
427 initializeOobe(); | |
428 }); | |
429 }); | 419 }); |
430 })(); | 420 })(); |
OLD | NEW |