| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 Common OOBE controller methods. | 6 * @fileoverview Common OOBE controller methods. This method is shared between |
| 7 * OOBE, login, and the lock screen. Add only methods that need to be shared |
| 8 * between all *three* screens here, as each additional method increases the |
| 9 * time it takes to show the lock screen. |
| 10 * |
| 11 * If a method needs to be shared between the oobe and login screens, add it to |
| 12 * login_non_lock_shared.js. |
| 7 */ | 13 */ |
| 8 | 14 |
| 9 <include src="test_util.js"> | 15 <include src="test_util.js"> |
| 10 <include src="../../../../../ui/login/screen.js"> | 16 <include src="../../../../../ui/login/screen.js"> |
| 11 <include src="screen_context.js"> | 17 <include src="screen_context.js"> |
| 12 <include src="../user_images_grid.js"> | 18 <include src="../user_images_grid.js"> |
| 13 <include src="apps_menu.js"> | 19 <include src="apps_menu.js"> |
| 14 <include src="../../../../../ui/login/bubble.js"> | 20 <include src="../../../../../ui/login/bubble.js"> |
| 15 <include src="../../../../../ui/login/display_manager.js"> | 21 <include src="../../../../../ui/login/display_manager.js"> |
| 16 <include src="header_bar.js"> | 22 <include src="header_bar.js"> |
| 17 <include src="network_dropdown.js"> | 23 |
| 18 <include src="oobe_screen_reset_confirmation_overlay.js"> | 24 <include src="../../../../../ui/login/account_picker/user_pod_template.js"> |
| 19 <include src="oobe_screen_reset.js"> | 25 |
| 20 <include src="oobe_screen_autolaunch.js"> | |
| 21 <include src="oobe_screen_enable_kiosk.js"> | |
| 22 <include src="oobe_screen_terms_of_service.js"> | |
| 23 <include src="oobe_screen_user_image.js"> | |
| 24 <include src="../../../../../ui/login/account_picker/screen_account_picker.js"> | 26 <include src="../../../../../ui/login/account_picker/screen_account_picker.js"> |
| 25 <include src="screen_app_launch_splash.js"> | 27 |
| 26 <include src="screen_error_message.js"> | |
| 27 <include src="screen_gaia_signin.js"> | |
| 28 <include src="screen_password_changed.js"> | |
| 29 <include src="screen_supervised_user_creation.js"> | |
| 30 <include src="screen_tpm_error.js"> | |
| 31 <include src="screen_wrong_hwid.js"> | |
| 32 <include src="screen_confirm_password.js"> | |
| 33 <include src="screen_fatal_error.js"> | |
| 34 <include src="screen_device_disabled.js"> | |
| 35 <include src="screen_unrecoverable_cryptohome_error.js"> | |
| 36 <include src="../../../../../ui/login/login_ui_tools.js"> | 28 <include src="../../../../../ui/login/login_ui_tools.js"> |
| 37 <include src="../../../../../ui/login/account_picker/user_pod_row.js"> | 29 <include src="../../../../../ui/login/account_picker/user_pod_row.js"> |
| 38 <include src="../../../../../ui/login/resource_loader.js"> | 30 <include src="../../../../../ui/login/resource_loader.js"> |
| 39 | 31 |
| 40 cr.define('cr.ui', function() { | 32 cr.define('cr.ui', function() { |
| 41 var DisplayManager = cr.ui.login.DisplayManager; | 33 var DisplayManager = cr.ui.login.DisplayManager; |
| 42 | 34 |
| 43 /** | 35 /** |
| 44 * Constructs an Out of box controller. It manages initialization of screens, | 36 * Constructs an Out of box controller. It manages initialization of screens, |
| 45 * transitions, error messages display. | 37 * transitions, error messages display. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 * @param {boolean} show True if version label should be visible. | 84 * @param {boolean} show True if version label should be visible. |
| 93 */ | 85 */ |
| 94 Oobe.showVersion = function(show) { | 86 Oobe.showVersion = function(show) { |
| 95 Oobe.getInstance().showVersion(show); | 87 Oobe.getInstance().showVersion(show); |
| 96 }; | 88 }; |
| 97 | 89 |
| 98 /** | 90 /** |
| 99 * Update body class to switch between OOBE UI and Login UI. | 91 * Update body class to switch between OOBE UI and Login UI. |
| 100 */ | 92 */ |
| 101 Oobe.showOobeUI = function(showOobe) { | 93 Oobe.showOobeUI = function(showOobe) { |
| 94 console.log('Oobe.showOobeUI(' + showOobe + ')'); |
| 102 if (showOobe) { | 95 if (showOobe) { |
| 103 document.body.classList.add('oobe-display'); | 96 document.body.classList.add('oobe-display'); |
| 104 | 97 |
| 105 // Callback to animate the header bar in. | 98 // Callback to animate the header bar in. |
| 106 var showHeaderBar = function() { | 99 var showHeaderBar = function() { |
| 107 login.HeaderBar.animateIn(false, function() { | 100 login.HeaderBar.animateIn(false, function() { |
| 108 chrome.send('headerBarVisible'); | 101 chrome.send('headerBarVisible'); |
| 109 }); | 102 }); |
| 110 }; | 103 }; |
| 111 // Start asynchronously so the OOBE network screen comes in first. | 104 // Start asynchronously so the OOBE network screen comes in first. |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 | 391 |
| 399 // Allow selection events on components with editable text (password field) | 392 // Allow selection events on components with editable text (password field) |
| 400 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) | 393 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) |
| 401 disableTextSelectAndDrag(function(e) { | 394 disableTextSelectAndDrag(function(e) { |
| 402 var src = e.target; | 395 var src = e.target; |
| 403 return src instanceof HTMLTextAreaElement || | 396 return src instanceof HTMLTextAreaElement || |
| 404 src instanceof HTMLInputElement && | 397 src instanceof HTMLInputElement && |
| 405 /text|password|search/.test(src.type); | 398 /text|password|search/.test(src.type); |
| 406 }); | 399 }); |
| 407 | 400 |
| 408 // Register assets for async loading. | |
| 409 [{ | |
| 410 id: SCREEN_OOBE_ENROLLMENT, | |
| 411 html: [{ url: 'chrome://oobe/enrollment.html', targetID: 'inner-container' }], | |
| 412 css: ['chrome://oobe/enrollment.css'], | |
| 413 js: ['chrome://oobe/enrollment.js'] | |
| 414 }].forEach(cr.ui.login.ResourceLoader.registerAssets); | |
| 415 | 401 |
| 416 (function() { | 402 (function() { |
| 417 'use strict'; | 403 'use strict'; |
| 418 | 404 |
| 419 document.addEventListener('DOMContentLoaded', function() { | 405 document.addEventListener('DOMContentLoaded', function() { |
| 420 // Immediately load async assets. | 406 Oobe.initialize(); |
| 421 // TODO(dconnelly): remove this at some point and only load as needed. | |
| 422 // See crbug.com/236426 | |
| 423 cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() { | |
| 424 // This screen is async-loaded so we manually trigger i18n processing. | |
| 425 i18nTemplate.process($('oauth-enrollment'), loadTimeData); | |
| 426 // Delayed binding since this isn't defined yet. | |
| 427 login.OAuthEnrollmentScreen.register(); | |
| 428 }); | |
| 429 | |
| 430 cr.ui.Oobe.initialize(); | |
| 431 }); | 407 }); |
| 432 })(); | 408 })(); |
| 409 |
| OLD | NEW |