Use same vk non-overscroll solution for both login and lock screens

Depends on https://codereview.chromium.org/254673004/ which
introduces new layout manager for LockScreenContainer.

This means that lock screen UI now supports resizing when virtual
keyboard is shown and overscroll is disabled. Custom code for
lock screen that "scrolled" user pods into view is not needed anymore,
reusing login UI solution (http://crbug.com/363635).

This CL partially reverts https://codereview.chromium.org/304153004

To disable lock screen scroll into view use same --disable-login-scroll-into-view

BUG=375666

Review URL: https://codereview.chromium.org/320523003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275800 0039d316-1c4b-4281-b951-d872f2087c98
parent aa501438
......@@ -51,11 +51,6 @@ std::string CanonicalizeUserID(const std::string& user_id) {
return gaia::CanonicalizeEmail(user_id);
}
bool LockScrollIntoViewEnabled() {
return !CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kDisableLockScrollIntoView);
}
bool LoginScrollIntoViewEnabled() {
return !CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kDisableLoginScrollIntoView);
......
......@@ -46,7 +46,6 @@ std::string CanonicalizeUserID(const std::string& user_id);
// Returns true if lock/login should scroll user pods into view itself when
// virtual keyboard is shown and disable vk overscroll.
bool LockScrollIntoViewEnabled();
bool LoginScrollIntoViewEnabled();
// A helper class for easily mocking out Network*Handler calls for tests.
......
......@@ -106,7 +106,7 @@ void WebUIScreenLocker::LockScreen() {
chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED,
content::NotificationService::AllSources());
if (login::LockScrollIntoViewEnabled())
if (login::LoginScrollIntoViewEnabled())
DisableKeyboardOverscroll();
}
......@@ -179,7 +179,7 @@ WebUIScreenLocker::~WebUIScreenLocker() {
ash::Shell::GetInstance()->delegate()->
RemoveVirtualKeyboardStateObserver(this);
if (login::LockScrollIntoViewEnabled())
if (login::LoginScrollIntoViewEnabled())
ResetKeyboardOverscrollOverride();
}
......@@ -388,14 +388,14 @@ void WebUIScreenLocker::OnKeyboardBoundsChanging(
// Keyboard has been hidden.
if (GetOobeUI()) {
GetOobeUI()->GetCoreOobeActor()->ShowControlBar(true);
if (login::LockScrollIntoViewEnabled())
if (login::LoginScrollIntoViewEnabled())
GetOobeUI()->GetCoreOobeActor()->SetKeyboardState(false, new_bounds);
}
} else if (!new_bounds.IsEmpty() && keyboard_bounds_.IsEmpty()) {
// Keyboard has been shown.
if (GetOobeUI()) {
GetOobeUI()->GetCoreOobeActor()->ShowControlBar(false);
if (login::LockScrollIntoViewEnabled())
if (login::LoginScrollIntoViewEnabled())
GetOobeUI()->GetCoreOobeActor()->SetKeyboardState(true, new_bounds);
}
}
......
......@@ -266,14 +266,6 @@ cr.define('cr.ui.login', function() {
setVirtualKeyboardSize: function(width, height) {
this.virtualKeyboardWidth_ = width;
this.virtualKeyboardHeight_ = height;
// Special case for screen lock. http://crbug.com/377904
// In case of virtual keyboard adjuct work area.
if (this.displayType == DISPLAY_TYPE.LOCK) {
var bottom = (height) ? height : $('login-header-bar').offsetHeight;
var clientArea = $('outer-container');
clientArea.style.bottom = cr.ui.toCssPx(bottom);
}
},
/**
......
......@@ -10,15 +10,12 @@
bottom: 51px; /* Leave space for the header bar */
display: -webkit-box;
left: 0;
min-height: 717px; /* This enables scrolling. Min resolution: 1024x768 */
position: absolute;
right: 0;
top: 0;
}
html[not(screen=lock)] #outer-container {
min-height: 717px; /* This enables scrolling. Min resolution: 1024x768 */
}
.oobe-display #outer-container.down {
-webkit-perspective: 600px;
}
......
......@@ -358,28 +358,18 @@ void CoreOobeHandler::UpdateDeviceRequisition() {
}
void CoreOobeHandler::UpdateKeyboardState() {
const std::string& ui_type = oobe_ui_->display_type();
if ((ui_type != OobeUI::kLockDisplay &&
login::LoginScrollIntoViewEnabled()) ||
(ui_type == OobeUI::kLockDisplay &&
login::LockScrollIntoViewEnabled())) {
keyboard::KeyboardController* keyboard_controller =
keyboard::KeyboardController::GetInstance();
if (keyboard_controller) {
gfx::Rect bounds = keyboard_controller->current_keyboard_bounds();
SetKeyboardState(!bounds.IsEmpty(), bounds);
}
if (!login::LoginScrollIntoViewEnabled())
return;
keyboard::KeyboardController* keyboard_controller =
keyboard::KeyboardController::GetInstance();
if (keyboard_controller) {
gfx::Rect bounds = keyboard_controller->current_keyboard_bounds();
SetKeyboardState(!bounds.IsEmpty(), bounds);
}
}
void CoreOobeHandler::UpdateClientAreaSize() {
// Special case for screen lock. http://crbug.com/377904
// No need to update client area size so that virtual keyboard works.
if (oobe_ui_->display_type() == OobeUI::kLockDisplay &&
login::LockScrollIntoViewEnabled()) {
return;
}
const gfx::Size& size = ash::Shell::GetScreen()->GetPrimaryDisplay().size();
SetClientAreaSize(size.width(), size.height());
}
......
......@@ -36,14 +36,10 @@ const char kDisableDemoMode[] = "disable-demo-mode";
// Disable Genius App and use the original Help App instead.
const char kDisableGeniusApp[] = "disable-genius-app";
// Disable lock UI (user pods) scrolling into view with CSS change when virtual
// keyboard is shown.
const char kDisableLockScrollIntoView[] = "disable-lock-scroll-into-view";
// Avoid doing expensive animations upon login.
const char kDisableLoginAnimations[] = "disable-login-animations";
// Disable login UI (user pods) scrolling into view on JS side when virtual
// Disable login/lock UI (user pods) scrolling into view on JS side when virtual
// keyboard is shown.
const char kDisableLoginScrollIntoView[] = "disable-login-scroll-into-view";
......
......@@ -29,7 +29,6 @@ CHROMEOS_EXPORT extern const char kDerelictIdleTimeout[];
CHROMEOS_EXPORT extern const char kDisableBootAnimation[];
CHROMEOS_EXPORT extern const char kDisableDemoMode[];
CHROMEOS_EXPORT extern const char kDisableGeniusApp[];
CHROMEOS_EXPORT extern const char kDisableLockScrollIntoView[];
CHROMEOS_EXPORT extern const char kDisableLoginAnimations[];
CHROMEOS_EXPORT extern const char kDisableLoginScrollIntoView[];
CHROMEOS_EXPORT extern const char kDisableNetworkPortalNotification[];
......
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