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

Unified Diff: ui/keyboard/keyboard_controller.cc

Issue 2629233003: Revert of Change the keyboard bounds when moving to another display. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « ui/keyboard/keyboard_controller.h ('k') | ui/keyboard/keyboard_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/keyboard_controller.cc
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc
index 638bd29f149b5923f4552bbd8fa47c6c7f70a058..674685b2658514392b3234f1774866e98b647261 100644
--- a/ui/keyboard/keyboard_controller.cc
+++ b/ui/keyboard/keyboard_controller.cc
@@ -283,7 +283,14 @@
if (keyboard_mode_ == FLOATING) {
NotifyKeyboardBoundsChanging(gfx::Rect());
} else if (keyboard_mode_ == FULL_WIDTH) {
- AdjustKeyboardBounds();
+ // TODO(bshe): revisit this logic after we decide to support resize virtual
+ // keyboard.
+ int keyboard_height = GetContainerWindow()->bounds().height();
+ const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds();
+ gfx::Rect new_bounds = root_bounds;
+ new_bounds.set_y(root_bounds.height() - keyboard_height);
+ new_bounds.set_height(keyboard_height);
+ GetContainerWindow()->SetBounds(new_bounds);
// No animation added, so call ShowAnimationFinished immediately.
ShowAnimationFinished();
}
@@ -312,7 +319,6 @@
void KeyboardController::OnWindowAddedToRootWindow(aura::Window* window) {
if (!window->GetRootWindow()->HasObserver(this))
window->GetRootWindow()->AddObserver(this);
- AdjustKeyboardBounds();
}
void KeyboardController::OnWindowRemovingFromRootWindow(aura::Window* window,
@@ -505,21 +511,4 @@
observer.OnKeyboardHidden();
}
-void KeyboardController::AdjustKeyboardBounds() {
- // When keyboard is floating, no resize is necessary.
- if (keyboard_mode_ == FLOATING)
- return;
-
- if (keyboard_mode_ == FULL_WIDTH) {
- // TODO(bshe): revisit this logic after we decide to support resize virtual
- // keyboard.
- int keyboard_height = GetContainerWindow()->bounds().height();
- const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds();
- gfx::Rect new_bounds = root_bounds;
- new_bounds.set_y(root_bounds.height() - keyboard_height);
- new_bounds.set_height(keyboard_height);
- GetContainerWindow()->SetBounds(new_bounds);
- }
-}
-
} // namespace keyboard
« no previous file with comments | « ui/keyboard/keyboard_controller.h ('k') | ui/keyboard/keyboard_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698