| Index: chrome/browser/resources/chromeos/login/display_manager.js
|
| diff --git a/chrome/browser/resources/chromeos/login/display_manager.js b/chrome/browser/resources/chromeos/login/display_manager.js
|
| index 85c97b1169cf524429c20105a7a201271ef32e33..638cc5c5207c0607d8e69e1edb5495be13773dd2 100644
|
| --- a/chrome/browser/resources/chromeos/login/display_manager.js
|
| +++ b/chrome/browser/resources/chromeos/login/display_manager.js
|
| @@ -53,6 +53,15 @@
|
| MANAGED_USER_CREATION_FLOW: 'ui-state-locally-managed'
|
| };
|
|
|
| +/* Possible types of UI. */
|
| +/** @const */ var DISPLAY_TYPE = {
|
| + UNKNOWN: 'unknown',
|
| + OOBE: 'oobe',
|
| + LOGIN: 'login',
|
| + LOCK: 'lock',
|
| + USER_ADDING: 'user-adding'
|
| +};
|
| +
|
| cr.define('cr.ui.login', function() {
|
| var Bubble = cr.ui.Bubble;
|
|
|
| @@ -130,6 +139,20 @@ cr.define('cr.ui.login', function() {
|
| forceKeyboardFlow_: false,
|
|
|
| /**
|
| + * Type of UI.
|
| + * @type {string}
|
| + */
|
| + displayType_: DISPLAY_TYPE.UNKNOWN,
|
| +
|
| + get displayType() {
|
| + return this.displayType_;
|
| + },
|
| +
|
| + set displayType(displayType) {
|
| + this.displayType_ = displayType;
|
| + },
|
| +
|
| + /**
|
| * Gets current screen element.
|
| * @type {HTMLElement}
|
| */
|
| @@ -348,8 +371,7 @@ cr.define('cr.ui.login', function() {
|
| }
|
| } else {
|
| // First screen on OOBE launch.
|
| - if (document.body.classList.contains('oobe-display') &&
|
| - innerContainer.classList.contains('down')) {
|
| + if (this.isOobeUI() && innerContainer.classList.contains('down')) {
|
| innerContainer.classList.remove('down');
|
| innerContainer.addEventListener(
|
| 'webkitTransitionEnd', function f(e) {
|
| @@ -366,8 +388,8 @@ cr.define('cr.ui.login', function() {
|
| } else {
|
| if (defaultControl)
|
| defaultControl.focus();
|
| + chrome.send('loginVisible', ['oobe']);
|
| }
|
| - newHeader.classList.remove('right'); // Old OOBE.
|
| }
|
| this.currentStep_ = nextStepIndex;
|
| $('oobe').className = nextStepId;
|
| @@ -564,23 +586,7 @@ cr.define('cr.ui.login', function() {
|
| * Returns true if Oobe UI is shown.
|
| */
|
| isOobeUI: function() {
|
| - return !document.body.classList.contains('login-display');
|
| - },
|
| -
|
| - /**
|
| - * Returns true if the current UI type is the "Sign-in to add user"
|
| - * (another user session is already active).
|
| - */
|
| - isSignInToAddScreen: function() {
|
| - return document.documentElement.getAttribute('screen') ==
|
| - 'user-adding';
|
| - },
|
| -
|
| - /**
|
| - * Returns true if the current UI type is the lock screen.
|
| - */
|
| - isLockScreen: function() {
|
| - return document.documentElement.getAttribute('screen') == 'lock';
|
| + return document.body.classList.contains('oobe-display');
|
| },
|
|
|
| /**
|
| @@ -595,16 +601,20 @@ cr.define('cr.ui.login', function() {
|
| * Initializes display manager.
|
| */
|
| DisplayManager.initialize = function() {
|
| - // Extracting screen type from URL.
|
| - var hash = window.location.hash;
|
| - var screenType;
|
| - if (!hash) {
|
| - console.error('Screen type not found. Setting default value "login".');
|
| - screenType = 'login';
|
| - } else {
|
| - screenType = hash.substring(1);
|
| + // Extracting display type from URL.
|
| + var path = window.location.pathname.substr(1);
|
| + var displayType = DISPLAY_TYPE.UNKNOWN;
|
| + Object.getOwnPropertyNames(DISPLAY_TYPE).forEach(function(type) {
|
| + if (DISPLAY_TYPE[type] == path) {
|
| + displayType = path;
|
| + }
|
| + });
|
| + if (displayType == DISPLAY_TYPE.UNKNOWN) {
|
| + console.error("Unknown display type '" + path + "'. Setting default.");
|
| + displayType = DISPLAY_TYPE.LOGIN;
|
| }
|
| - document.documentElement.setAttribute('screen', screenType);
|
| + Oobe.getInstance().displayType = displayType;
|
| + document.documentElement.setAttribute('screen', displayType);
|
|
|
| var link = $('enterprise-info-hint-link');
|
| link.addEventListener(
|
|
|