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 26 matching lines...) Expand all Loading... |
37 namespace { | 37 namespace { |
38 | 38 |
39 const int kHideKeyboardDelayMs = 100; | 39 const int kHideKeyboardDelayMs = 100; |
40 | 40 |
41 // The virtual keyboard show/hide animation duration. | 41 // The virtual keyboard show/hide animation duration. |
42 const int kShowAnimationDurationMs = 350; | 42 const int kShowAnimationDurationMs = 350; |
43 const int kHideAnimationDurationMs = 100; | 43 const int kHideAnimationDurationMs = 100; |
44 | 44 |
45 // The opacity of virtual keyboard container when show animation starts or | 45 // The opacity of virtual keyboard container when show animation starts or |
46 // hide animation finishes. | 46 // hide animation finishes. |
47 // TODO(rsadam@): Investigate why setting this to zero crashes. | 47 const float kAnimationStartOrAfterHideOpacity = 0; |
48 const float kAnimationStartOrAfterHideOpacity = 0.01f; | |
49 | 48 |
50 // Event targeter for the keyboard container. | 49 // Event targeter for the keyboard container. |
51 class KeyboardContainerTargeter : public wm::MaskedWindowTargeter { | 50 class KeyboardContainerTargeter : public wm::MaskedWindowTargeter { |
52 public: | 51 public: |
53 KeyboardContainerTargeter(aura::Window* container, | 52 KeyboardContainerTargeter(aura::Window* container, |
54 keyboard::KeyboardControllerProxy* proxy) | 53 keyboard::KeyboardControllerProxy* proxy) |
55 : wm::MaskedWindowTargeter(container), | 54 : wm::MaskedWindowTargeter(container), |
56 proxy_(proxy) { | 55 proxy_(proxy) { |
57 } | 56 } |
58 | 57 |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 proxy_->HideKeyboardContainer(container_.get()); | 576 proxy_->HideKeyboardContainer(container_.get()); |
578 } | 577 } |
579 | 578 |
580 void KeyboardController::AddBoundsChangedObserver(aura::Window* window) { | 579 void KeyboardController::AddBoundsChangedObserver(aura::Window* window) { |
581 aura::Window* target_window = GetFrameWindow(window); | 580 aura::Window* target_window = GetFrameWindow(window); |
582 if (target_window) | 581 if (target_window) |
583 window_bounds_observer_->AddObservedWindow(target_window); | 582 window_bounds_observer_->AddObservedWindow(target_window); |
584 } | 583 } |
585 | 584 |
586 } // namespace keyboard | 585 } // namespace keyboard |
OLD | NEW |