| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 HIDE_REASON_AUTOMATIC, | 57 HIDE_REASON_AUTOMATIC, |
| 58 // User initiated. | 58 // User initiated. |
| 59 HIDE_REASON_MANUAL, | 59 HIDE_REASON_MANUAL, |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // Takes ownership of |ui|. | 62 // Takes ownership of |ui|. |
| 63 explicit KeyboardController(KeyboardUI* ui, KeyboardLayoutDelegate* delegate); | 63 explicit KeyboardController(KeyboardUI* ui, KeyboardLayoutDelegate* delegate); |
| 64 ~KeyboardController() override; | 64 ~KeyboardController() override; |
| 65 | 65 |
| 66 // Returns the container for the keyboard, which is owned by | 66 // Returns the container for the keyboard, which is owned by |
| 67 // KeyboardController. | 67 // KeyboardController. Creates the container if it's not already created. |
| 68 aura::Window* GetContainerWindow(); | 68 aura::Window* GetContainerWindow(); |
| 69 | 69 |
| 70 // Same as GetContainerWindow except that this function doesn't create the |
| 71 // window. |
| 72 aura::Window* GetContainerWindowWithoutCreationForTest(); |
| 73 |
| 70 // Whether the container window for the keyboard has been initialized. | 74 // Whether the container window for the keyboard has been initialized. |
| 71 bool keyboard_container_initialized() const { return container_ != nullptr; } | 75 bool keyboard_container_initialized() const { return container_ != nullptr; } |
| 72 | 76 |
| 73 // Reloads the content of the keyboard. No-op if the keyboard content is not | 77 // Reloads the content of the keyboard. No-op if the keyboard content is not |
| 74 // loaded yet. | 78 // loaded yet. |
| 75 void Reload(); | 79 void Reload(); |
| 76 | 80 |
| 77 // Hides virtual keyboard and notifies observer bounds change. | 81 // Hides virtual keyboard and notifies observer bounds change. |
| 78 // This function should be called with a delay to avoid layout flicker | 82 // This function should be called with a delay to avoid layout flicker |
| 79 // when the focus of input field quickly change. |automatic| is true when the | 83 // when the focus of input field quickly change. |automatic| is true when the |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 static KeyboardController* instance_; | 191 static KeyboardController* instance_; |
| 188 | 192 |
| 189 base::WeakPtrFactory<KeyboardController> weak_factory_; | 193 base::WeakPtrFactory<KeyboardController> weak_factory_; |
| 190 | 194 |
| 191 DISALLOW_COPY_AND_ASSIGN(KeyboardController); | 195 DISALLOW_COPY_AND_ASSIGN(KeyboardController); |
| 192 }; | 196 }; |
| 193 | 197 |
| 194 } // namespace keyboard | 198 } // namespace keyboard |
| 195 | 199 |
| 196 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 200 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
| OLD | NEW |