OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/keyboard/keyboard_controller.h" | 5 #include "ui/keyboard/keyboard_controller.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 // Notify observers after animation finished to prevent reveal desktop | 508 // Notify observers after animation finished to prevent reveal desktop |
509 // background during animation. | 509 // background during animation. |
510 NotifyKeyboardBoundsChanging(container_->bounds()); | 510 NotifyKeyboardBoundsChanging(container_->bounds()); |
511 ui_->EnsureCaretInWorkArea(); | 511 ui_->EnsureCaretInWorkArea(); |
512 } | 512 } |
513 | 513 |
514 void KeyboardController::HideAnimationFinished() { | 514 void KeyboardController::HideAnimationFinished() { |
515 ui_->HideKeyboardContainer(container_.get()); | 515 ui_->HideKeyboardContainer(container_.get()); |
516 for (KeyboardControllerObserver& observer : observer_list_) | 516 for (KeyboardControllerObserver& observer : observer_list_) |
517 observer.OnKeyboardHidden(); | 517 observer.OnKeyboardHidden(); |
| 518 ui_->EnsureCaretInWorkArea(); |
518 } | 519 } |
519 | 520 |
520 void KeyboardController::AdjustKeyboardBounds() { | 521 void KeyboardController::AdjustKeyboardBounds() { |
521 // When keyboard is floating, no resize is necessary. | 522 // When keyboard is floating, no resize is necessary. |
522 if (keyboard_mode_ == FLOATING) | 523 if (keyboard_mode_ == FLOATING) |
523 return; | 524 return; |
524 | 525 |
525 if (keyboard_mode_ == FULL_WIDTH) { | 526 if (keyboard_mode_ == FULL_WIDTH) { |
526 // TODO(bshe): revisit this logic after we decide to support resize virtual | 527 // TODO(bshe): revisit this logic after we decide to support resize virtual |
527 // keyboard. | 528 // keyboard. |
528 int keyboard_height = GetContainerWindow()->bounds().height(); | 529 int keyboard_height = GetContainerWindow()->bounds().height(); |
529 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); | 530 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); |
530 gfx::Rect new_bounds = root_bounds; | 531 gfx::Rect new_bounds = root_bounds; |
531 new_bounds.set_y(root_bounds.height() - keyboard_height); | 532 new_bounds.set_y(root_bounds.height() - keyboard_height); |
532 new_bounds.set_height(keyboard_height); | 533 new_bounds.set_height(keyboard_height); |
533 GetContainerWindow()->SetBounds(new_bounds); | 534 GetContainerWindow()->SetBounds(new_bounds); |
534 } | 535 } |
535 } | 536 } |
536 | 537 |
537 } // namespace keyboard | 538 } // namespace keyboard |
OLD | NEW |