| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Hides virtual keyboard and notifies observer bounds change. | 75 // Hides virtual keyboard and notifies observer bounds change. |
| 76 // This function should be called with a delay to avoid layout flicker | 76 // This function should be called with a delay to avoid layout flicker |
| 77 // when the focus of input field quickly change. |automatic| is true when the | 77 // when the focus of input field quickly change. |automatic| is true when the |
| 78 // call is made by the system rather than initiated by the user. | 78 // call is made by the system rather than initiated by the user. |
| 79 void HideKeyboard(HideReason reason); | 79 void HideKeyboard(HideReason reason); |
| 80 | 80 |
| 81 // Notifies the keyboard observer for keyboard bounds changed. | 81 // Notifies the keyboard observer for keyboard bounds changed. |
| 82 void NotifyKeyboardBoundsChanging(const gfx::Rect& new_bounds); | 82 void NotifyKeyboardBoundsChanging(const gfx::Rect& new_bounds); |
| 83 | 83 |
| 84 // Management of the observer list. | 84 // Management of the observer list. |
| 85 virtual void AddObserver(KeyboardControllerObserver* observer); | 85 void AddObserver(KeyboardControllerObserver* observer); |
| 86 virtual void RemoveObserver(KeyboardControllerObserver* observer); | 86 void RemoveObserver(KeyboardControllerObserver* observer); |
| 87 bool HasObserver(KeyboardControllerObserver* observer) const; |
| 87 | 88 |
| 88 KeyboardUI* ui() { return ui_.get(); } | 89 KeyboardUI* ui() { return ui_.get(); } |
| 89 | 90 |
| 90 void set_lock_keyboard(bool lock) { lock_keyboard_ = lock; } | 91 void set_lock_keyboard(bool lock) { lock_keyboard_ = lock; } |
| 91 | 92 |
| 92 KeyboardMode keyboard_mode() const { return keyboard_mode_; } | 93 KeyboardMode keyboard_mode() const { return keyboard_mode_; } |
| 93 | 94 |
| 94 void SetKeyboardMode(KeyboardMode mode); | 95 void SetKeyboardMode(KeyboardMode mode); |
| 95 | 96 |
| 96 // Force the keyboard to show up if not showing and lock the keyboard if | 97 // Force the keyboard to show up if not showing and lock the keyboard if |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 static KeyboardController* instance_; | 171 static KeyboardController* instance_; |
| 171 | 172 |
| 172 base::WeakPtrFactory<KeyboardController> weak_factory_; | 173 base::WeakPtrFactory<KeyboardController> weak_factory_; |
| 173 | 174 |
| 174 DISALLOW_COPY_AND_ASSIGN(KeyboardController); | 175 DISALLOW_COPY_AND_ASSIGN(KeyboardController); |
| 175 }; | 176 }; |
| 176 | 177 |
| 177 } // namespace keyboard | 178 } // namespace keyboard |
| 178 | 179 |
| 179 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 180 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
| OLD | NEW |