Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2778)

Unified Diff: chrome/browser/resources/chromeos/login/login_common.js

Issue 599273004: Polished UI for the host side of pairing flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@merge_point
Patch Set: Fixed error in Oobe initialization. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..23b8208dca92fb44d4cf2cba9b49a9068e87892b 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 (!window['WAIT_FOR_POLYMER']) {
+ initializeOobe();
+ return;
+ }
+ window.addEventListener('polymer-ready', function() {
+ initializeOobe();
+ });
+ });
+})();
« no previous file with comments | « chrome/browser/resources/chromeos/login/html-echo.js ('k') | chrome/browser/resources/chromeos/login/login_resources.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698