Commit fc1bf27b authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Remove lock screen note code from login web UI

BUG=929466

Change-Id: I4e58d5fb14ce82097665c5bad34a1f779b38c04f
Reviewed-on: https://chromium-review.googlesource.com/c/1457667
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630619}
parent c74a3814
......@@ -1215,9 +1215,6 @@
<message name="IDS_LOGIN_NEEDS_DIRCRYPTO_MIGRATION_BANNER" desc="Banner text for users that need to migrate their data to use dircrypto.">
A critical update is ready to install. Sign in to get started.
</message>
<message name="IDS_LOGIN_NEW_LOCK_SCREEN_NOTE_BUTTON_TITLE" desc="Title for the button on the Chrome OS lock screen that launches an app for taking notes (the action of creating a new note is delegated to the app). The string is primarily intended to be spoken out by accessibility tools - the button is represented by an icon in the lock screen UI.">
Create new note
</message>
<!-- Network error strings -->
<message name="IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN" desc="Network error details in notifications: UNKNOWN">
......
......@@ -15,11 +15,6 @@
padding-top: 7px;
}
#login-header-bar.full-header-background {
background-color: #000;
border-top: 1px solid #000;
}
#login-header-bar.translucent-background {
background-color: rgba(0, 0, 0, 0.9);
}
......
......@@ -77,21 +77,6 @@
</svg>
</iron-iconset-svg>
<iron-iconset-svg name="header-bar-48" size="48">
<svg>
<defs>
<g id="unlock-1x" fill-rule="evenodd">
<path d="M24 34c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm12-18h-2v-4c0-5.52-4.48-10-10-10S14 6.48 14 12h3.8c0-3.42 2.78-6.2 6.2-6.2 3.42 0 6.2 2.78 6.2 6.2v4H12c-2.21 0-4 1.79-4 4v20c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V20c0-2.21-1.79-4-4-4zm0 24H12V20h24v20z">
</path>
</g>
<g id="unlock-2x" fill-rule="evenodd">
<path d="M24 34c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm12-18h-2v-4c0-5.52-4.48-10-10-10S14 6.48 14 12h3.8c0-3.42 2.78-6.2 6.2-6.2 3.42 0 6.2 2.78 6.2 6.2v4H12c-2.21 0-4 1.79-4 4v20c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V20c0-2.21-1.79-4-4-4zm0 24H12V20h24v20z">
</path>
</g>
</defs>
</svg>
</iron-iconset-svg>
<link rel="stylesheet" href="oobe_flex_layout.css">
<div id="login-header-bar" hidden
class="login-header-bar-hidden layout horizontal">
......@@ -174,14 +159,4 @@
</div>
</button>
</div>
<div id="unlock-user-header-bar-item" class="header-bar-item" hidden>
<button id="unlock-user-button" class="custom-appearance layout vertical">
<div class="flex layout horizontal center">
<hd-iron-icon
icon1x="header-bar-48:unlock-1x" icon2x="header-bar-48:unlock-2x">
</hd-iron-icon>
<div i18n-content="unlockUser"></div>
</div>
</button>
</div>
</div>
......@@ -7,16 +7,6 @@
*/
cr.define('login', function() {
/**
* Enum for user actions taken from lock screen header while a lock screen
* app is in background.
* @enum {string}
*/
var LOCK_SCREEN_APPS_UNLOCK_ACTION = {
SIGN_OUT: 'LOCK_SCREEN_APPS_UNLOCK_ACTION.SIGN_OUT',
SHUTDOWN: 'LOCK_SCREEN_APPS_UNLOCK_ACTION.SHUTDOWN'
};
/**
* Creates a header bar element.
*
......@@ -42,13 +32,6 @@ cr.define('login', function() {
// Current UI state of the sign-in screen.
signinUIState_: SIGNIN_UI_STATE.HIDDEN,
// Current lock screen apps activity state. This value affects visibility of
// tray buttons visible in the header bar - when lock screeen apps state is
// FOREGROUND, only the unlock button should be shown (when clicked, the
// button issues a request to move lock screen apps to background, in the
// state where account picker is visible).
lockScreenAppsState_: LOCK_SCREEN_APPS_STATE.NONE,
// Whether to show kiosk apps menu.
hasApps_: false,
......@@ -73,8 +56,6 @@ cr.define('login', function() {
.addEventListener('click', this.handleSignoutClick_.bind(this));
$('cancel-multiple-sign-in-button')
.addEventListener('click', this.handleCancelMultipleSignInClick_);
$('unlock-user-button')
.addEventListener('click', this.handleUnlockUserClick_);
if (Oobe.getInstance().displayType == DISPLAY_TYPE.LOGIN ||
Oobe.getInstance().displayType == DISPLAY_TYPE.OOBE) {
if (Oobe.getInstance().newKioskUI)
......@@ -208,17 +189,6 @@ cr.define('login', function() {
e.stopPropagation();
},
/**
* Unlock user button handler. Sends a request to Chrome to show user pods
* in foreground.
*
* @private
*/
handleUnlockUserClick_: function(e) {
chrome.send('closeLockScreenApp');
e.preventDefault();
},
/**
* If true then "Browse as Guest" button is shown.
*
......@@ -263,16 +233,6 @@ cr.define('login', function() {
this.updateUI_();
},
/**
* Current activity state of lock screen app windows.
*
* @type {LOCK_SCREEN_APPS_STATE}
*/
set lockScreenAppsState(state) {
this.lockScreenAppsState_ = state;
this.updateUI_();
},
/**
* Update whether there are kiosk apps.
*
......@@ -313,14 +273,9 @@ cr.define('login', function() {
isMultiProfilesUI || (gaiaIsActive && $('gaia-signin').closable) ||
(enrollmentIsActive && !$('oauth-enrollment').isAtTheBeginning()) ||
(gaiaIsActive && !$('gaia-signin').isAtTheBeginning());
$('restart-header-bar-item').hidden = !this.showReboot_ ||
this.lockScreenAppsState_ == LOCK_SCREEN_APPS_STATE.FOREGROUND;
$('shutdown-header-bar-item').hidden = !this.showShutdown_ ||
this.lockScreenAppsState_ == LOCK_SCREEN_APPS_STATE.FOREGROUND;
$('sign-out-user-item').hidden = !isLockScreen ||
this.lockScreenAppsState_ == LOCK_SCREEN_APPS_STATE.FOREGROUND;
$('unlock-user-header-bar-item').hidden = !isLockScreen ||
this.lockScreenAppsState_ != LOCK_SCREEN_APPS_STATE.FOREGROUND;
$('restart-header-bar-item').hidden = !this.showReboot_;
$('shutdown-header-bar-item').hidden = !this.showShutdown_;
$('sign-out-user-item').hidden = !isLockScreen;
$('add-user-header-bar-item').hidden = $('add-user-button').hidden;
$('apps-header-bar-item').hidden =
......@@ -331,14 +286,6 @@ cr.define('login', function() {
if (!$('apps-header-bar-item').hidden)
$('show-apps-button').didShow();
}
// Lock screen apps are generally shown maximized - update the header
// bar background opacity so the wallpaper is not visible behind it (
// since it won't be visible in the rest of UI).
this.classList.toggle(
'full-header-background',
this.lockScreenAppsState_ == LOCK_SCREEN_APPS_STATE.FOREGROUND ||
this.lockScreenAppsState_ == LOCK_SCREEN_APPS_STATE.BACKGROUND);
},
/**
......
......@@ -14,7 +14,6 @@
// <include src="../../../../../ui/login/bubble.js">
// <include src="../../../../../ui/login/display_manager.js">
// <include src="md_header_bar.js">
// <include src="md_top_header_bar.js">
// <include src="demo_mode_test_helper.js">
// <include
......@@ -137,7 +136,6 @@ cr.define('cr.ui.Oobe', function() {
cr.ui.Bubble.decorate($('bubble'));
login.HeaderBar.decorate($('login-header-bar'));
login.TopHeaderBar.decorate($('top-header-bar'));
chrome.send('screenStateInitialize');
......
......@@ -13,92 +13,3 @@
min-height: 0;
width: 100%;
}
#top-header-bar.version-labels-unset #version-labels {
display: none;
}
.new-note-action-container {
display: flex;
flex: 0;
height: 56px;
justify-content: flex-end;
min-height: 0;
min-width: 56px;
overflow: hidden;
width: 56px;
z-index: 1;
}
.new-note-action {
-webkit-tap-highlight-color: transparent;
background-color: rgba(158, 158, 158, 0.34);
border-radius: 0 0 0 48px;
cursor: pointer;
display: flex;
height: 48px;
justify-content: flex-end;
min-height: 0;
transition-duration: 300ms;
transition-property: border-radius, height, width;
width: 48px;
z-index: 1;
}
html[dir=rtl] .new-note-action {
border-radius: 0 0 48px 0;
}
.new-note-action:hover,
.new-note-action:focus {
background-color: rgba(158, 158, 158, 0.46);
border-radius: 0 0 0 56px;
height: 56px;
outline: none;
width: 56px;
}
html[dir=rtl] .new-note-action:hover,
html[dir=rtl] .new-note-action:focus {
border-radius: 0 0 56px 0;
}
.new-note-action-icon {
height: 16px;
padding-inline-end: 11px;
padding-top: 12px;
width: 16px;
}
.new-note-background {
background-color: black;
border-radius: 0 0 0 100%;
bottom: auto;
display: none;
left: auto;
position: absolute;
right: 0;
top: 0;
transform-origin: top right;
z-index: 1;
}
.new-note-background.new-note-action-above-login-header {
z-index: 5;
}
html[dir=rtl] .new-note-background {
border-radius: 0 0 100% 0;
left: 0;
right: auto;
transform-origin: top left;
}
#top-header-bar.new-note-activated .new-note-background {
display: block;
}
.new-note-background-animated {
transition-duration: 300ms;
transition-property: opacity, transform;
}
<iron-iconset-svg name="new-note-action" size="16">
<svg>
<defs>
<g id="action-icon" fill="none" fill-rule="evenodd">
<path d="M0 0h16v16H0"></path>
<path fill="#FFF" fill-rule="nonzero" d="M8.993 1.007h-4.67c-.734 0-1.327.6-1.327 1.333L2.99 13.69c0 .734.592 1.31 1.326 1.31h7.362c.733 0 1.333-.576 1.333-1.31V4.984L8.994 1.007zM9 6V2.535L12.542 6H9z"></path>
</g>
</defs>
</svg>
</iron-iconset-svg>
<div id="top-header-bar">
<div class="top-header-bar-strip">
<div id="version-labels" hidden>
......@@ -16,15 +5,5 @@
<div id="asset-id"></div>
<div id="bluetooth-name" hidden></div>
</div>
<div hidden id="new-note-action-container"
class="new-note-action-container">
<div role="button" id="new-note-action" class="new-note-action"
tabindex="0" i18n-values="aria-label:newLockScreenNoteButton">
<iron-icon icon="new-note-action:action-icon"
id="new-note-action-icon" class="new-note-action-icon">
</iron-icon>
</div>
</div>
</div>
<div id="new-note-background" class="new-note-background"></div>
</div>
......@@ -15,7 +15,6 @@
// <include src="../../../../../ui/login/bubble.js">
// <include src="../../../../../ui/login/display_manager.js">
// <include src="md_header_bar.js">
// <include src="md_top_header_bar.js">
// <include src="demo_mode_test_helper.js">
// <include
......@@ -144,8 +143,6 @@ cr.define('cr.ui.Oobe', function() {
cr.ui.Bubble.decorate($('bubble'));
login.HeaderBar.decorate($('login-header-bar'));
if ($('top-header-bar'))
login.TopHeaderBar.decorate($('top-header-bar'));
Oobe.initializeA11yMenu();
......
......@@ -335,7 +335,6 @@ void SigninScreenHandler::DeclareLocalizedValues(
builder->Add("moreOptions", IDS_MORE_OPTIONS_BUTTON);
builder->Add("cancel", IDS_ASH_SHELF_CANCEL_BUTTON);
builder->Add("signOutUser", IDS_ASH_SHELF_SIGN_OUT_BUTTON);
builder->Add("unlockUser", IDS_ASH_SHELF_UNLOCK_BUTTON);
builder->Add("offlineLogin", IDS_OFFLINE_LOGIN_HTML);
builder->Add("ownerUserPattern", IDS_LOGIN_POD_OWNER_USER);
builder->Add("removeUser", IDS_LOGIN_POD_REMOVE_USER);
......@@ -451,9 +450,6 @@ void SigninScreenHandler::DeclareLocalizedValues(
IDS_LOGIN_UNRECOVERABLE_CRYPTOHOME_ERROR_CONTINUE);
builder->Add("unrecoverableCryptohomeErrorRecreatingProfile",
IDS_LOGIN_UNRECOVERABLE_CRYPTOHOME_ERROR_WAIT_MESSAGE);
builder->Add("newLockScreenNoteButton",
IDS_LOGIN_NEW_LOCK_SCREEN_NOTE_BUTTON_TITLE);
}
void SigninScreenHandler::RegisterMessages() {
......
......@@ -45,7 +45,6 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() {
'setPublicSessionDisplayName',
'setPublicSessionLocales',
'setPublicSessionKeyboardLayouts',
'setLockScreenAppsState',
'setOverlayColors',
'togglePodBackground',
],
......@@ -59,9 +58,6 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() {
// Whether this screen is currently being shown.
showing_: false,
// Last reported lock screen app activity state.
lockScreenAppsState_: LOCK_SCREEN_APPS_STATE.NONE,
/** @override */
decorate: function() {
login.PodRow.decorate($('pod-row'));
......@@ -126,9 +122,6 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() {
onBeforeShow: function(data) {
this.showing_ = true;
this.ownerDocument.addEventListener('click',
this.handleOwnerDocClick_.bind(this));
chrome.send('loginUIStateChanged', ['account-picker', true]);
$('login-header-bar').signinUIState = SIGNIN_UI_STATE.ACCOUNT_PICKER;
chrome.send('hideCaptivePortal');
......@@ -463,58 +456,5 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() {
setPublicSessionKeyboardLayouts: function(userID, locale, list) {
$('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list);
},
/**
* Updates UI based on the provided lock screen apps state.
*
* @param {LOCK_SCREEN_APPS_STATE} state The current lock screen apps state.
*/
setLockScreenAppsState: function(state) {
if (Oobe.getInstance().displayType != DISPLAY_TYPE.LOCK ||
state == this.lockScreenAppsState_) {
return;
}
var wasForeground =
this.lockScreenAppsState_ === LOCK_SCREEN_APPS_STATE.FOREGROUND;
this.lockScreenAppsState_ = state;
$('top-header-bar').lockScreenAppsState = state;
// Reset the focused pod if app window is being shown on top of the user
// pods. Main goal is to clear any credentials the user might have input.
if (state === LOCK_SCREEN_APPS_STATE.FOREGROUND) {
$('pod-row').clearFocusedPod();
$('pod-row').disabled = true;
} else {
$('pod-row').disabled = false;
if (wasForeground) {
// If the app window was moved to background, ensure the active pod is
// focused.
$('pod-row').maybePreselectPod();
$('pod-row').refocusCurrentPod();
}
}
},
/**
* Handles clicks on the document which displays the account picker UI.
* If the click event target is outer container - i.e. background portion of
* UI with no other UI elements, and lock screen apps are in background, a
* request is issued to chrome to move lock screen apps to foreground.
* @param {Event} event The click event.
*/
handleOwnerDocClick_: function(event) {
if (this.lockScreenAppsState_ != LOCK_SCREEN_APPS_STATE.BACKGROUND ||
(event.target != $('account-picker') &&
event.target != $('version'))) {
return;
}
chrome.send('setLockScreenAppsState',
[LOCK_SCREEN_APPS_STATE.FOREGROUND]);
event.preventDefault();
event.stopPropagation();
},
};
});
......@@ -42,7 +42,6 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() {
'setPublicSessionDisplayName',
'setPublicSessionLocales',
'setPublicSessionKeyboardLayouts',
'setLockScreenAppsState',
],
preferredWidth_: 0,
......@@ -54,14 +53,9 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() {
// Whether this screen is currently being shown.
showing_: false,
// Last reported lock screen app activity state.
lockScreenAppsState_: LOCK_SCREEN_APPS_STATE.NONE,
/** @override */
decorate: function() {
login.PodRow.decorate($('pod-row'));
this.ownerDocument.addEventListener(
'click', this.handleOwnerDocClick_.bind(this));
},
/** @override */
......@@ -449,50 +443,5 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() {
setPublicSessionKeyboardLayouts: function(userID, locale, list) {
$('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list);
},
/**
* Updates UI based on the provided lock screen apps state.
*
* @param {LOCK_SCREEN_APPS_STATE} state The current lock screen apps
* state.
*/
setLockScreenAppsState: function(state) {
if (Oobe.getInstance().displayType != DISPLAY_TYPE.LOCK ||
state == this.lockScreenAppsState_) {
return;
}
this.lockScreenAppsState_ = state;
$('login-header-bar').lockScreenAppsState = state;
// When an lock screen app window is in background - i.e. visible behind
// the lock screen UI - dim the lock screen background, so it's more
// noticeable that the app widow in background is not actionable.
$('background')
.classList.toggle(
'dimmed-background', state == LOCK_SCREEN_APPS_STATE.BACKGROUND);
if (state === LOCK_SCREEN_APPS_STATE.FOREGROUND)
$('pod-row').clearFocusedPod();
},
/**
* Handles clicks on the document which displays the account picker UI.
* If the click event target is outer container - i.e. background portion
* of UI with no other UI elements, and lock screen apps are in background,
* a request is issued to chrome to move lock screen apps to foreground.
* @param {Event} event The click event.
*/
handleOwnerDocClick_: function(event) {
if (this.lockScreenAppsState_ != LOCK_SCREEN_APPS_STATE.BACKGROUND ||
event.target != $('outer-container')) {
return;
}
chrome.send(
'setLockScreenAppsState', [LOCK_SCREEN_APPS_STATE.FOREGROUND]);
event.preventDefault();
event.stopPropagation();
},
};
});
......@@ -100,20 +100,6 @@
GAIA_SIGNIN: 'gaia-signin'
};
/* Possible lock screen enabled app activity state. */
/** @const */ var LOCK_SCREEN_APPS_STATE = {
// No lock screen enabled app available.
NONE: 'LOCK_SCREEN_APPS_STATE.NONE',
// A lock screen enabled note taking app is available, but has not been
// launched to handle a lock screen action.
AVAILABLE: 'LOCK_SCREEN_APPS_STATE.AVAILABLE',
// A lock screen enabled app is running in background - behind lock screen UI.
BACKGROUND: 'LOCK_SCREEN_APPS_STATE.BACKGROUND',
// A lock screen enabled app is running in foreground - an app window is
// shown over the lock screen user pods (header bar should still be visible).
FOREGROUND: 'LOCK_SCREEN_APPS_STATE.FOREGROUND',
};
/** @const */ var USER_ACTION_ROLLBACK_TOGGLED = 'rollback-toggled';
cr.define('cr.ui.login', function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment