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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 root_window()->SetBounds( | 213 root_window()->SetBounds( |
214 gfx::Rect(0, 0, root_bounds.height(), root_bounds.width())); | 214 gfx::Rect(0, 0, root_bounds.height(), root_bounds.width())); |
215 } | 215 } |
216 | 216 |
217 protected: | 217 protected: |
218 // KeyboardControllerObserver overrides | 218 // KeyboardControllerObserver overrides |
219 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override { | 219 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override { |
220 notified_bounds_ = new_bounds; | 220 notified_bounds_ = new_bounds; |
221 number_of_calls_++; | 221 number_of_calls_++; |
222 } | 222 } |
| 223 void OnKeyboardHidden() override {} |
223 | 224 |
224 int number_of_calls() const { return number_of_calls_; } | 225 int number_of_calls() const { return number_of_calls_; } |
225 | 226 |
226 const gfx::Rect& notified_bounds() { return notified_bounds_; } | 227 const gfx::Rect& notified_bounds() { return notified_bounds_; } |
227 | 228 |
228 void SetFocus(ui::TextInputClient* client) { | 229 void SetFocus(ui::TextInputClient* client) { |
229 ui::InputMethod* input_method = ui()->GetInputMethod(); | 230 ui::InputMethod* input_method = ui()->GetInputMethod(); |
230 input_method->SetFocusedTextInputClient(client); | 231 input_method->SetFocusedTextInputClient(client); |
231 if (client && client->GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) { | 232 if (client && client->GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) { |
232 input_method->ShowImeIfNeeded(); | 233 input_method->ShowImeIfNeeded(); |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 gfx::Rect new_bounds(0, 0, 1280, 800); | 659 gfx::Rect new_bounds(0, 0, 1280, 800); |
659 ASSERT_NE(new_bounds, root_window()->bounds()); | 660 ASSERT_NE(new_bounds, root_window()->bounds()); |
660 EXPECT_EQ(1, number_of_calls()); | 661 EXPECT_EQ(1, number_of_calls()); |
661 root_window()->SetBounds(new_bounds); | 662 root_window()->SetBounds(new_bounds); |
662 EXPECT_EQ(2, number_of_calls()); | 663 EXPECT_EQ(2, number_of_calls()); |
663 MockRotateScreen(); | 664 MockRotateScreen(); |
664 EXPECT_EQ(3, number_of_calls()); | 665 EXPECT_EQ(3, number_of_calls()); |
665 } | 666 } |
666 | 667 |
667 } // namespace keyboard | 668 } // namespace keyboard |
OLD | NEW |