| 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 container_->SetTransform(gfx::Transform()); | 503 container_->SetTransform(gfx::Transform()); |
| 504 container_->layer()->SetOpacity(1.0); | 504 container_->layer()->SetOpacity(1.0); |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 | 507 |
| 508 bool KeyboardController::WillHideKeyboard() const { | 508 bool KeyboardController::WillHideKeyboard() const { |
| 509 return weak_factory_.HasWeakPtrs(); | 509 return weak_factory_.HasWeakPtrs(); |
| 510 } | 510 } |
| 511 | 511 |
| 512 void KeyboardController::ShowAnimationFinished() { | 512 void KeyboardController::ShowAnimationFinished() { |
| 513 MarkKeyboardLoadFinished(); |
| 514 |
| 513 // Notify observers after animation finished to prevent reveal desktop | 515 // Notify observers after animation finished to prevent reveal desktop |
| 514 // background during animation. | 516 // background during animation. |
| 515 NotifyKeyboardBoundsChanging(container_->bounds()); | 517 NotifyKeyboardBoundsChanging(container_->bounds()); |
| 516 ui_->EnsureCaretInWorkArea(); | 518 ui_->EnsureCaretInWorkArea(); |
| 517 } | 519 } |
| 518 | 520 |
| 519 void KeyboardController::HideAnimationFinished() { | 521 void KeyboardController::HideAnimationFinished() { |
| 520 ui_->HideKeyboardContainer(container_.get()); | 522 ui_->HideKeyboardContainer(container_.get()); |
| 521 for (KeyboardControllerObserver& observer : observer_list_) | 523 for (KeyboardControllerObserver& observer : observer_list_) |
| 522 observer.OnKeyboardHidden(); | 524 observer.OnKeyboardHidden(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 534 int keyboard_height = GetContainerWindow()->bounds().height(); | 536 int keyboard_height = GetContainerWindow()->bounds().height(); |
| 535 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); | 537 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); |
| 536 gfx::Rect new_bounds = root_bounds; | 538 gfx::Rect new_bounds = root_bounds; |
| 537 new_bounds.set_y(root_bounds.height() - keyboard_height); | 539 new_bounds.set_y(root_bounds.height() - keyboard_height); |
| 538 new_bounds.set_height(keyboard_height); | 540 new_bounds.set_height(keyboard_height); |
| 539 GetContainerWindow()->SetBounds(new_bounds); | 541 GetContainerWindow()->SetBounds(new_bounds); |
| 540 } | 542 } |
| 541 } | 543 } |
| 542 | 544 |
| 543 } // namespace keyboard | 545 } // namespace keyboard |
| OLD | NEW |