Chromium Code Reviews| 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 28 matching lines...) Expand all Loading... | |
| 39 #include "ui/ozone/public/input_controller.h" | 39 #include "ui/ozone/public/input_controller.h" |
| 40 #include "ui/ozone/public/ozone_platform.h" | 40 #include "ui/ozone/public/ozone_platform.h" |
| 41 #endif | 41 #endif |
| 42 #endif // if defined(OS_CHROMEOS) | 42 #endif // if defined(OS_CHROMEOS) |
| 43 | 43 |
| 44 namespace { | 44 namespace { |
| 45 | 45 |
| 46 const int kHideKeyboardDelayMs = 100; | 46 const int kHideKeyboardDelayMs = 100; |
| 47 | 47 |
| 48 // The virtual keyboard show/hide animation duration. | 48 // The virtual keyboard show/hide animation duration. |
| 49 const int kShowAnimationDurationMs = 350; | 49 const int kShowAnimationDurationMs = 100; |
| 50 const int kHideAnimationDurationMs = 100; | 50 const int kHideAnimationDurationMs = 100; |
|
yhanada
2017/05/15 07:37:53
As we are going to consolidate the durations of sh
| |
| 51 | 51 |
| 52 // The opacity of virtual keyboard container when show animation starts or | 52 // The opacity of virtual keyboard container when show animation starts or |
| 53 // hide animation finishes. This cannot be zero because we call Show() on the | 53 // hide animation finishes. This cannot be zero because we call Show() on the |
| 54 // keyboard window before setting the opacity back to 1.0. Since windows are not | 54 // keyboard window before setting the opacity back to 1.0. Since windows are not |
| 55 // allowed to be shown with zero opacity, we always animate to 0.01 instead. | 55 // allowed to be shown with zero opacity, we always animate to 0.01 instead. |
| 56 const float kAnimationStartOrAfterHideOpacity = 0.01f; | 56 const float kAnimationStartOrAfterHideOpacity = 0.01f; |
| 57 | 57 |
| 58 // The KeyboardWindowDelegate makes sure the keyboard-window does not get focus. | 58 // The KeyboardWindowDelegate makes sure the keyboard-window does not get focus. |
| 59 // This is necessary to make sure that the synthetic key-events reach the target | 59 // This is necessary to make sure that the synthetic key-events reach the target |
| 60 // window. | 60 // window. |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 534 int keyboard_height = GetContainerWindow()->bounds().height(); | 534 int keyboard_height = GetContainerWindow()->bounds().height(); |
| 535 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); | 535 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); |
| 536 gfx::Rect new_bounds = root_bounds; | 536 gfx::Rect new_bounds = root_bounds; |
| 537 new_bounds.set_y(root_bounds.height() - keyboard_height); | 537 new_bounds.set_y(root_bounds.height() - keyboard_height); |
| 538 new_bounds.set_height(keyboard_height); | 538 new_bounds.set_height(keyboard_height); |
| 539 GetContainerWindow()->SetBounds(new_bounds); | 539 GetContainerWindow()->SetBounds(new_bounds); |
| 540 } | 540 } |
| 541 } | 541 } |
| 542 | 542 |
| 543 } // namespace keyboard | 543 } // namespace keyboard |
| OLD | NEW |