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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 class TestKeyboardUI : public KeyboardUI { | 89 class TestKeyboardUI : public KeyboardUI { |
90 public: | 90 public: |
91 TestKeyboardUI(ui::InputMethod* input_method) : input_method_(input_method) {} | 91 TestKeyboardUI(ui::InputMethod* input_method) : input_method_(input_method) {} |
92 ~TestKeyboardUI() override { | 92 ~TestKeyboardUI() override { |
93 // Destroy the window before the delegate. | 93 // Destroy the window before the delegate. |
94 window_.reset(); | 94 window_.reset(); |
95 } | 95 } |
96 | 96 |
97 // Overridden from KeyboardUI: | 97 // Overridden from KeyboardUI: |
98 bool HasKeyboardWindow() const override { return window_; } | 98 bool HasKeyboardWindow() const override { return window_; } |
| 99 bool ShouldWindowOverscroll(aura::Window* window) const override { |
| 100 return true; |
| 101 } |
99 aura::Window* GetKeyboardWindow() override { | 102 aura::Window* GetKeyboardWindow() override { |
100 if (!window_) { | 103 if (!window_) { |
101 window_.reset(new aura::Window(&delegate_)); | 104 window_.reset(new aura::Window(&delegate_)); |
102 window_->Init(ui::LAYER_NOT_DRAWN); | 105 window_->Init(ui::LAYER_NOT_DRAWN); |
103 window_->set_owned_by_parent(false); | 106 window_->set_owned_by_parent(false); |
104 } | 107 } |
105 return window_.get(); | 108 return window_.get(); |
106 } | 109 } |
107 ui::InputMethod* GetInputMethod() override { return input_method_; } | 110 ui::InputMethod* GetInputMethod() override { return input_method_; } |
108 void SetUpdateInputType(ui::TextInputType type) override {} | 111 void SetUpdateInputType(ui::TextInputType type) override {} |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 // Before hide animation finishes, show keyboard again. | 606 // Before hide animation finishes, show keyboard again. |
604 ShowKeyboard(); | 607 ShowKeyboard(); |
605 RunAnimationForLayer(layer); | 608 RunAnimationForLayer(layer); |
606 EXPECT_TRUE(keyboard_container()->IsVisible()); | 609 EXPECT_TRUE(keyboard_container()->IsVisible()); |
607 EXPECT_TRUE(keyboard_window()->IsVisible()); | 610 EXPECT_TRUE(keyboard_window()->IsVisible()); |
608 EXPECT_EQ(1.0, layer->opacity()); | 611 EXPECT_EQ(1.0, layer->opacity()); |
609 EXPECT_EQ(gfx::Transform(), layer->transform()); | 612 EXPECT_EQ(gfx::Transform(), layer->transform()); |
610 } | 613 } |
611 | 614 |
612 } // namespace keyboard | 615 } // namespace keyboard |
OLD | NEW |