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 <memory> | 7 #include <memory> |
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 root_window()->SetBounds( | 209 root_window()->SetBounds( |
210 gfx::Rect(0, 0, root_bounds.height(), root_bounds.width())); | 210 gfx::Rect(0, 0, root_bounds.height(), root_bounds.width())); |
211 } | 211 } |
212 | 212 |
213 protected: | 213 protected: |
214 // KeyboardControllerObserver overrides | 214 // KeyboardControllerObserver overrides |
215 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override { | 215 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override { |
216 notified_bounds_ = new_bounds; | 216 notified_bounds_ = new_bounds; |
217 number_of_calls_++; | 217 number_of_calls_++; |
218 } | 218 } |
| 219 void OnKeyboardClosed() override {} |
219 | 220 |
220 int number_of_calls() const { return number_of_calls_; } | 221 int number_of_calls() const { return number_of_calls_; } |
221 | 222 |
222 const gfx::Rect& notified_bounds() { return notified_bounds_; } | 223 const gfx::Rect& notified_bounds() { return notified_bounds_; } |
223 | 224 |
224 void SetFocus(ui::TextInputClient* client) { | 225 void SetFocus(ui::TextInputClient* client) { |
225 ui::InputMethod* input_method = ui()->GetInputMethod(); | 226 ui::InputMethod* input_method = ui()->GetInputMethod(); |
226 input_method->SetFocusedTextInputClient(client); | 227 input_method->SetFocusedTextInputClient(client); |
227 if (client && client->GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) { | 228 if (client && client->GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) { |
228 input_method->ShowImeIfNeeded(); | 229 input_method->ShowImeIfNeeded(); |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 gfx::Rect new_bounds(0, 0, 1280, 800); | 652 gfx::Rect new_bounds(0, 0, 1280, 800); |
652 ASSERT_NE(new_bounds, root_window()->bounds()); | 653 ASSERT_NE(new_bounds, root_window()->bounds()); |
653 EXPECT_EQ(1, number_of_calls()); | 654 EXPECT_EQ(1, number_of_calls()); |
654 root_window()->SetBounds(new_bounds); | 655 root_window()->SetBounds(new_bounds); |
655 EXPECT_EQ(2, number_of_calls()); | 656 EXPECT_EQ(2, number_of_calls()); |
656 MockRotateScreen(); | 657 MockRotateScreen(); |
657 EXPECT_EQ(3, number_of_calls()); | 658 EXPECT_EQ(3, number_of_calls()); |
658 } | 659 } |
659 | 660 |
660 } // namespace keyboard | 661 } // namespace keyboard |
OLD | NEW |