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

Unified Diff: chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc

Issue 304153004: Center lock screen user pod when virtual keyboard is shown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add separate disable switch Created 6 years, 7 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/ui/webui/chromeos/login/core_oobe_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
index 977fa6c4cb0ae00f9f36308d4a9f70bedb749087..17bbb9405d193025937bc19ffe766591d97ab233 100644
--- a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
@@ -45,6 +45,9 @@ const char kJsApiSkipUpdateEnrollAfterEula[] = "skipUpdateEnrollAfterEula";
const char kJsApiScreenAssetsLoaded[] = "screenAssetsLoaded";
const char kJsApiHeaderBarVisible[] = "headerBarVisible";
+// Lock UI type.
+const char kLockDisplay[] = "lock";
dzhioev (left Google) 2014/05/29 15:42:52 I prefer to expose display types constant from "oo
Nikita (slow) 2014/05/29 15:51:20 Done. I was trying to minimize changes in this CL
+
} // namespace
namespace chromeos {
@@ -218,8 +221,8 @@ void CoreOobeHandler::ShowControlBar(bool show) {
CallJS("showControlBar", show);
}
-void CoreOobeHandler::SetKeyboardState(bool shown) {
- CallJS("setKeyboardState", shown);
+void CoreOobeHandler::SetKeyboardState(bool shown, const gfx::Rect& bounds) {
+ CallJS("setKeyboardState", shown, bounds.width(), bounds.height());
}
void CoreOobeHandler::SetClientAreaSize(int width, int height) {
@@ -358,17 +361,26 @@ void CoreOobeHandler::UpdateDeviceRequisition() {
}
void CoreOobeHandler::UpdateKeyboardState() {
- if (login::LoginScrollIntoViewEnabled()) {
+ const std::string& ui_type = oobe_ui_->display_type();
+ if ((ui_type != kLockDisplay && login::LoginScrollIntoViewEnabled()) ||
+ (ui_type == kLockDisplay && login::LockScrollIntoViewEnabled())) {
keyboard::KeyboardController* keyboard_controller =
keyboard::KeyboardController::GetInstance();
if (keyboard_controller) {
gfx::Rect bounds = keyboard_controller->current_keyboard_bounds();
- SetKeyboardState(!bounds.IsEmpty());
+ 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() == kLockDisplay &&
+ login::LockScrollIntoViewEnabled()) {
+ return;
+ }
+
const gfx::Size& size = ash::Shell::GetScreen()->GetPrimaryDisplay().size();
SetClientAreaSize(size.width(), size.height());
}

Powered by Google App Engine
This is Rietveld 408576698