| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // Hides virtual keyboard and notifies observer bounds change. | 81 // Hides virtual keyboard and notifies observer bounds change. |
| 82 // 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 |
| 83 // 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 |
| 84 // call is made by the system rather than initiated by the user. | 84 // call is made by the system rather than initiated by the user. |
| 85 void HideKeyboard(HideReason reason); | 85 void HideKeyboard(HideReason reason); |
| 86 | 86 |
| 87 // Notifies the keyboard observer for keyboard bounds changed. | 87 // Notifies the keyboard observer for keyboard bounds changed. |
| 88 void NotifyKeyboardBoundsChanging(const gfx::Rect& new_bounds); | 88 void NotifyKeyboardBoundsChanging(const gfx::Rect& new_bounds); |
| 89 | 89 |
| 90 // Management of the observer list. | 90 // Management of the observer list. |
| 91 virtual void AddObserver(KeyboardControllerObserver* observer); | 91 void AddObserver(KeyboardControllerObserver* observer); |
| 92 virtual void RemoveObserver(KeyboardControllerObserver* observer); | 92 bool HasObserver(KeyboardControllerObserver* observer); |
| 93 void RemoveObserver(KeyboardControllerObserver* observer); |
| 93 | 94 |
| 94 KeyboardUI* ui() { return ui_.get(); } | 95 KeyboardUI* ui() { return ui_.get(); } |
| 95 | 96 |
| 96 void set_keyboard_locked(bool lock) { keyboard_locked_ = lock; } | 97 void set_keyboard_locked(bool lock) { keyboard_locked_ = lock; } |
| 97 | 98 |
| 98 bool keyboard_locked() const { return keyboard_locked_; } | 99 bool keyboard_locked() const { return keyboard_locked_; } |
| 99 | 100 |
| 100 KeyboardMode keyboard_mode() const { return keyboard_mode_; } | 101 KeyboardMode keyboard_mode() const { return keyboard_mode_; } |
| 101 | 102 |
| 102 void SetKeyboardMode(KeyboardMode mode); | 103 void SetKeyboardMode(KeyboardMode mode); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 static KeyboardController* instance_; | 192 static KeyboardController* instance_; |
| 192 | 193 |
| 193 base::WeakPtrFactory<KeyboardController> weak_factory_; | 194 base::WeakPtrFactory<KeyboardController> weak_factory_; |
| 194 | 195 |
| 195 DISALLOW_COPY_AND_ASSIGN(KeyboardController); | 196 DISALLOW_COPY_AND_ASSIGN(KeyboardController); |
| 196 }; | 197 }; |
| 197 | 198 |
| 198 } // namespace keyboard | 199 } // namespace keyboard |
| 199 | 200 |
| 200 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 201 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
| OLD | NEW |