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 #ifndef UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 5 #ifndef UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
6 #define UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 6 #define UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
7 | 7 |
8 #include "base/event_types.h" | 8 #include "base/event_types.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 // Takes ownership of |ui|. | 59 // Takes ownership of |ui|. |
60 explicit KeyboardController(KeyboardUI* ui); | 60 explicit KeyboardController(KeyboardUI* ui); |
61 ~KeyboardController() override; | 61 ~KeyboardController() override; |
62 | 62 |
63 // Returns the container for the keyboard, which is owned by | 63 // Returns the container for the keyboard, which is owned by |
64 // KeyboardController. | 64 // KeyboardController. |
65 aura::Window* GetContainerWindow(); | 65 aura::Window* GetContainerWindow(); |
66 | 66 |
67 // Whether the container window for the keyboard has been initialized. | 67 // Whether the container window for the keyboard has been initialized. |
68 bool keyboard_container_initialized() const { | 68 bool keyboard_container_initialized() const { return container_; } |
69 return container_.get() != NULL; | |
70 } | |
71 | 69 |
72 // Reloads the content of the keyboard. No-op if the keyboard content is not | 70 // Reloads the content of the keyboard. No-op if the keyboard content is not |
73 // loaded yet. | 71 // loaded yet. |
74 void Reload(); | 72 void Reload(); |
75 | 73 |
76 // Hides virtual keyboard and notifies observer bounds change. | 74 // Hides virtual keyboard and notifies observer bounds change. |
77 // This function should be called with a delay to avoid layout flicker | 75 // This function should be called with a delay to avoid layout flicker |
78 // when the focus of input field quickly change. |automatic| is true when the | 76 // when the focus of input field quickly change. |automatic| is true when the |
79 // call is made by the system rather than initiated by the user. | 77 // call is made by the system rather than initiated by the user. |
80 void HideKeyboard(HideReason reason); | 78 void HideKeyboard(HideReason reason); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 static KeyboardController* instance_; | 169 static KeyboardController* instance_; |
172 | 170 |
173 base::WeakPtrFactory<KeyboardController> weak_factory_; | 171 base::WeakPtrFactory<KeyboardController> weak_factory_; |
174 | 172 |
175 DISALLOW_COPY_AND_ASSIGN(KeyboardController); | 173 DISALLOW_COPY_AND_ASSIGN(KeyboardController); |
176 }; | 174 }; |
177 | 175 |
178 } // namespace keyboard | 176 } // namespace keyboard |
179 | 177 |
180 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 178 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
OLD | NEW |