| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 void NotifyKeyboardBoundsChanging(const gfx::Rect& new_bounds); | 85 void NotifyKeyboardBoundsChanging(const gfx::Rect& new_bounds); |
| 86 | 86 |
| 87 // Management of the observer list. | 87 // Management of the observer list. |
| 88 virtual void AddObserver(KeyboardControllerObserver* observer); | 88 virtual void AddObserver(KeyboardControllerObserver* observer); |
| 89 virtual void RemoveObserver(KeyboardControllerObserver* observer); | 89 virtual void RemoveObserver(KeyboardControllerObserver* observer); |
| 90 | 90 |
| 91 KeyboardControllerProxy* proxy() { return proxy_.get(); } | 91 KeyboardControllerProxy* proxy() { return proxy_.get(); } |
| 92 | 92 |
| 93 void set_lock_keyboard(bool lock) { lock_keyboard_ = lock; } | 93 void set_lock_keyboard(bool lock) { lock_keyboard_ = lock; } |
| 94 | 94 |
| 95 KeyboardMode keyboard_mode() const { return keyboard_mode_; } |
| 96 |
| 95 void SetKeyboardMode(KeyboardMode mode); | 97 void SetKeyboardMode(KeyboardMode mode); |
| 96 | 98 |
| 97 // Force the keyboard to show up if not showing and lock the keyboard if | 99 // Force the keyboard to show up if not showing and lock the keyboard if |
| 98 // |lock| is true. | 100 // |lock| is true. |
| 99 void ShowKeyboard(bool lock); | 101 void ShowKeyboard(bool lock); |
| 100 | 102 |
| 101 // Sets the active keyboard controller. KeyboardController takes ownership of | 103 // Sets the active keyboard controller. KeyboardController takes ownership of |
| 102 // the instance. Calling ResetIntance with a new instance destroys the | 104 // the instance. Calling ResetIntance with a new instance destroys the |
| 103 // previous one. May be called with NULL to clear the instance. | 105 // previous one. May be called with NULL to clear the instance. |
| 104 static void ResetInstance(KeyboardController* controller); | 106 static void ResetInstance(KeyboardController* controller); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 122 | 124 |
| 123 // Updates insets on web content window | 125 // Updates insets on web content window |
| 124 void UpdateWindowInsets(aura::Window* window); | 126 void UpdateWindowInsets(aura::Window* window); |
| 125 | 127 |
| 126 private: | 128 private: |
| 127 // For access to Observer methods for simulation. | 129 // For access to Observer methods for simulation. |
| 128 friend class KeyboardControllerTest; | 130 friend class KeyboardControllerTest; |
| 129 | 131 |
| 130 // aura::WindowObserver overrides | 132 // aura::WindowObserver overrides |
| 131 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; | 133 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; |
| 134 void OnWindowAddedToRootWindow(aura::Window* window) override; |
| 135 void OnWindowRemovingFromRootWindow(aura::Window* window, |
| 136 aura::Window* new_root) override; |
| 137 void OnWindowBoundsChanged(aura::Window* window, |
| 138 const gfx::Rect& old_bounds, |
| 139 const gfx::Rect& new_bounds) override; |
| 132 | 140 |
| 133 // InputMethodObserver overrides | 141 // InputMethodObserver overrides |
| 134 void OnTextInputTypeChanged(const ui::TextInputClient* client) override {} | 142 void OnTextInputTypeChanged(const ui::TextInputClient* client) override {} |
| 135 void OnFocus() override {} | 143 void OnFocus() override {} |
| 136 void OnBlur() override {} | 144 void OnBlur() override {} |
| 137 void OnCaretBoundsChanged(const ui::TextInputClient* client) override {} | 145 void OnCaretBoundsChanged(const ui::TextInputClient* client) override {} |
| 138 void OnTextInputStateChanged(const ui::TextInputClient* client) override; | 146 void OnTextInputStateChanged(const ui::TextInputClient* client) override; |
| 139 void OnInputMethodDestroyed(const ui::InputMethod* input_method) override; | 147 void OnInputMethodDestroyed(const ui::InputMethod* input_method) override; |
| 140 void OnShowImeIfNeeded() override; | 148 void OnShowImeIfNeeded() override; |
| 141 | 149 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 static KeyboardController* instance_; | 189 static KeyboardController* instance_; |
| 182 | 190 |
| 183 base::WeakPtrFactory<KeyboardController> weak_factory_; | 191 base::WeakPtrFactory<KeyboardController> weak_factory_; |
| 184 | 192 |
| 185 DISALLOW_COPY_AND_ASSIGN(KeyboardController); | 193 DISALLOW_COPY_AND_ASSIGN(KeyboardController); |
| 186 }; | 194 }; |
| 187 | 195 |
| 188 } // namespace keyboard | 196 } // namespace keyboard |
| 189 | 197 |
| 190 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 198 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
| OLD | NEW |