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() { return keyboard_mode_; } | |
sadrul
2015/04/01 06:43:49
KeyboardMode keyboard_mode() const { return ... }
bshe
2015/04/01 20:41:33
Done.
| |
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 11 matching lines...) Expand all Loading... | |
116 const gfx::Rect& current_keyboard_bounds() { | 118 const gfx::Rect& current_keyboard_bounds() { |
117 return current_keyboard_bounds_; | 119 return current_keyboard_bounds_; |
118 } | 120 } |
119 | 121 |
120 // Determines whether a particular window should have insets for overscroll. | 122 // Determines whether a particular window should have insets for overscroll. |
121 bool ShouldEnableInsets(aura::Window* window); | 123 bool ShouldEnableInsets(aura::Window* window); |
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 |
128 // Called when the root window bounds changed. | |
129 void OnRootWindowResized(const gfx::Rect& bounds); | |
130 | |
126 private: | 131 private: |
127 // For access to Observer methods for simulation. | 132 // For access to Observer methods for simulation. |
128 friend class KeyboardControllerTest; | 133 friend class KeyboardControllerTest; |
129 | 134 |
130 // aura::WindowObserver overrides | 135 // aura::WindowObserver overrides |
131 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; | 136 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; |
132 | 137 |
133 // InputMethodObserver overrides | 138 // InputMethodObserver overrides |
134 void OnTextInputTypeChanged(const ui::TextInputClient* client) override {} | 139 void OnTextInputTypeChanged(const ui::TextInputClient* client) override {} |
135 void OnFocus() override {} | 140 void OnFocus() override {} |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 static KeyboardController* instance_; | 186 static KeyboardController* instance_; |
182 | 187 |
183 base::WeakPtrFactory<KeyboardController> weak_factory_; | 188 base::WeakPtrFactory<KeyboardController> weak_factory_; |
184 | 189 |
185 DISALLOW_COPY_AND_ASSIGN(KeyboardController); | 190 DISALLOW_COPY_AND_ASSIGN(KeyboardController); |
186 }; | 191 }; |
187 | 192 |
188 } // namespace keyboard | 193 } // namespace keyboard |
189 | 194 |
190 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 195 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
OLD | NEW |