| 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/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void NotifyKeyboardBoundsChanging(const gfx::Rect& new_bounds); | 69 void NotifyKeyboardBoundsChanging(const gfx::Rect& new_bounds); |
| 70 | 70 |
| 71 // Management of the observer list. | 71 // Management of the observer list. |
| 72 virtual void AddObserver(KeyboardControllerObserver* observer); | 72 virtual void AddObserver(KeyboardControllerObserver* observer); |
| 73 virtual void RemoveObserver(KeyboardControllerObserver* observer); | 73 virtual void RemoveObserver(KeyboardControllerObserver* observer); |
| 74 | 74 |
| 75 KeyboardControllerProxy* proxy() { return proxy_.get(); } | 75 KeyboardControllerProxy* proxy() { return proxy_.get(); } |
| 76 | 76 |
| 77 void set_lock_keyboard(bool lock) { lock_keyboard_ = lock; } | 77 void set_lock_keyboard(bool lock) { lock_keyboard_ = lock; } |
| 78 | 78 |
| 79 // Force the keyboard to show up if not showing and lock the keyboard. | 79 // Force the keyboard to show up if not showing and lock the keyboard if |
| 80 void ShowAndLockKeyboard(); | 80 // |lock| is true. |
| 81 void ShowKeyboard(bool lock); |
| 81 | 82 |
| 82 // Sets the active keyboard controller. KeyboardController takes ownership of | 83 // Sets the active keyboard controller. KeyboardController takes ownership of |
| 83 // the instance. Calling ResetIntance with a new instance destroys the | 84 // the instance. Calling ResetIntance with a new instance destroys the |
| 84 // previous one. May be called with NULL to clear the instance. | 85 // previous one. May be called with NULL to clear the instance. |
| 85 static void ResetInstance(KeyboardController* controller); | 86 static void ResetInstance(KeyboardController* controller); |
| 86 | 87 |
| 87 // Retrieve the active keyboard controller. | 88 // Retrieve the active keyboard controller. |
| 88 static KeyboardController* GetInstance(); | 89 static KeyboardController* GetInstance(); |
| 89 | 90 |
| 90 // Returns true if keyboard is currently visible. | 91 // Returns true if keyboard is currently visible. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 111 virtual void OnBlur() OVERRIDE {} | 112 virtual void OnBlur() OVERRIDE {} |
| 112 virtual void OnCaretBoundsChanged( | 113 virtual void OnCaretBoundsChanged( |
| 113 const ui::TextInputClient* client) OVERRIDE {} | 114 const ui::TextInputClient* client) OVERRIDE {} |
| 114 virtual void OnTextInputStateChanged( | 115 virtual void OnTextInputStateChanged( |
| 115 const ui::TextInputClient* client) OVERRIDE; | 116 const ui::TextInputClient* client) OVERRIDE; |
| 116 virtual void OnInputMethodDestroyed( | 117 virtual void OnInputMethodDestroyed( |
| 117 const ui::InputMethod* input_method) OVERRIDE; | 118 const ui::InputMethod* input_method) OVERRIDE; |
| 118 virtual void OnShowImeIfNeeded() OVERRIDE; | 119 virtual void OnShowImeIfNeeded() OVERRIDE; |
| 119 | 120 |
| 120 // Show virtual keyboard immediately with animation. | 121 // Show virtual keyboard immediately with animation. |
| 121 void ShowKeyboard(); | 122 void ShowKeyboardInternal(); |
| 122 | 123 |
| 123 // Returns true if keyboard is scheduled to hide. | 124 // Returns true if keyboard is scheduled to hide. |
| 124 bool WillHideKeyboard() const; | 125 bool WillHideKeyboard() const; |
| 125 | 126 |
| 126 // Called when show and hide animation finished successfully. If the animation | 127 // Called when show and hide animation finished successfully. If the animation |
| 127 // is aborted, it won't be called. | 128 // is aborted, it won't be called. |
| 128 void ShowAnimationFinished(); | 129 void ShowAnimationFinished(); |
| 129 void HideAnimationFinished(); | 130 void HideAnimationFinished(); |
| 130 | 131 |
| 131 scoped_ptr<KeyboardControllerProxy> proxy_; | 132 scoped_ptr<KeyboardControllerProxy> proxy_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 147 gfx::Rect current_keyboard_bounds_; | 148 gfx::Rect current_keyboard_bounds_; |
| 148 | 149 |
| 149 static KeyboardController* instance_; | 150 static KeyboardController* instance_; |
| 150 | 151 |
| 151 DISALLOW_COPY_AND_ASSIGN(KeyboardController); | 152 DISALLOW_COPY_AND_ASSIGN(KeyboardController); |
| 152 }; | 153 }; |
| 153 | 154 |
| 154 } // namespace keyboard | 155 } // namespace keyboard |
| 155 | 156 |
| 156 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 157 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
| OLD | NEW |