| 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 // Notify observers after animation finished to prevent reveal desktop | 498 // Notify observers after animation finished to prevent reveal desktop |
| 499 // background during animation. | 499 // background during animation. |
| 500 NotifyKeyboardBoundsChanging(container_->bounds()); | 500 NotifyKeyboardBoundsChanging(container_->bounds()); |
| 501 ui_->EnsureCaretInWorkArea(); | 501 ui_->EnsureCaretInWorkArea(); |
| 502 } | 502 } |
| 503 | 503 |
| 504 void KeyboardController::HideAnimationFinished() { | 504 void KeyboardController::HideAnimationFinished() { |
| 505 ui_->HideKeyboardContainer(container_.get()); | 505 ui_->HideKeyboardContainer(container_.get()); |
| 506 for (KeyboardControllerObserver& observer : observer_list_) | 506 for (KeyboardControllerObserver& observer : observer_list_) |
| 507 observer.OnKeyboardHidden(); | 507 observer.OnKeyboardHidden(); |
| 508 ui_->EnsureCaretInWorkArea(); |
| 508 } | 509 } |
| 509 | 510 |
| 510 void KeyboardController::AdjustKeyboardBounds() { | 511 void KeyboardController::AdjustKeyboardBounds() { |
| 511 // When keyboard is floating, no resize is necessary. | 512 // When keyboard is floating, no resize is necessary. |
| 512 if (keyboard_mode_ == FLOATING) | 513 if (keyboard_mode_ == FLOATING) |
| 513 return; | 514 return; |
| 514 | 515 |
| 515 if (keyboard_mode_ == FULL_WIDTH) { | 516 if (keyboard_mode_ == FULL_WIDTH) { |
| 516 // TODO(bshe): revisit this logic after we decide to support resize virtual | 517 // TODO(bshe): revisit this logic after we decide to support resize virtual |
| 517 // keyboard. | 518 // keyboard. |
| 518 int keyboard_height = GetContainerWindow()->bounds().height(); | 519 int keyboard_height = GetContainerWindow()->bounds().height(); |
| 519 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); | 520 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); |
| 520 gfx::Rect new_bounds = root_bounds; | 521 gfx::Rect new_bounds = root_bounds; |
| 521 new_bounds.set_y(root_bounds.height() - keyboard_height); | 522 new_bounds.set_y(root_bounds.height() - keyboard_height); |
| 522 new_bounds.set_height(keyboard_height); | 523 new_bounds.set_height(keyboard_height); |
| 523 GetContainerWindow()->SetBounds(new_bounds); | 524 GetContainerWindow()->SetBounds(new_bounds); |
| 524 } | 525 } |
| 525 } | 526 } |
| 526 | 527 |
| 527 } // namespace keyboard | 528 } // namespace keyboard |
| OLD | NEW |