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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // the instance. Calling ResetIntance with a new instance destroys the | 86 // the instance. Calling ResetIntance with a new instance destroys the |
87 // previous one. May be called with NULL to clear the instance. | 87 // previous one. May be called with NULL to clear the instance. |
88 static void ResetInstance(KeyboardController* controller); | 88 static void ResetInstance(KeyboardController* controller); |
89 | 89 |
90 // Retrieve the active keyboard controller. | 90 // Retrieve the active keyboard controller. |
91 static KeyboardController* GetInstance(); | 91 static KeyboardController* GetInstance(); |
92 | 92 |
93 // Returns true if keyboard is currently visible. | 93 // Returns true if keyboard is currently visible. |
94 bool keyboard_visible() { return keyboard_visible_; } | 94 bool keyboard_visible() { return keyboard_visible_; } |
95 | 95 |
96 bool show_on_resize() { return show_on_resize_; } | |
97 | |
98 // Returns the current keyboard bounds. When the keyboard is not shown, | 96 // Returns the current keyboard bounds. When the keyboard is not shown, |
99 // an empty rectangle will get returned. | 97 // an empty rectangle will get returned. |
100 const gfx::Rect& current_keyboard_bounds() { | 98 const gfx::Rect& current_keyboard_bounds() { |
101 return current_keyboard_bounds_; | 99 return current_keyboard_bounds_; |
102 } | 100 } |
103 | 101 |
104 // Updates insets on web content window | 102 // Updates insets on web content window |
105 void UpdateWindowInsets(aura::Window* window); | 103 void UpdateWindowInsets(aura::Window* window); |
106 | 104 |
107 private: | 105 private: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 scoped_ptr<KeyboardControllerProxy> proxy_; | 146 scoped_ptr<KeyboardControllerProxy> proxy_; |
149 scoped_ptr<aura::Window> container_; | 147 scoped_ptr<aura::Window> container_; |
150 // CallbackAnimationObserver should destructed before container_ because it | 148 // CallbackAnimationObserver should destructed before container_ because it |
151 // uses container_'s animator. | 149 // uses container_'s animator. |
152 scoped_ptr<CallbackAnimationObserver> animation_observer_; | 150 scoped_ptr<CallbackAnimationObserver> animation_observer_; |
153 | 151 |
154 scoped_ptr<WindowBoundsChangeObserver> window_bounds_observer_; | 152 scoped_ptr<WindowBoundsChangeObserver> window_bounds_observer_; |
155 | 153 |
156 ui::InputMethod* input_method_; | 154 ui::InputMethod* input_method_; |
157 bool keyboard_visible_; | 155 bool keyboard_visible_; |
158 bool show_on_resize_; | |
159 bool lock_keyboard_; | 156 bool lock_keyboard_; |
160 ui::TextInputType type_; | 157 ui::TextInputType type_; |
161 | 158 |
162 ObserverList<KeyboardControllerObserver> observer_list_; | 159 ObserverList<KeyboardControllerObserver> observer_list_; |
163 | 160 |
164 base::WeakPtrFactory<KeyboardController> weak_factory_; | 161 base::WeakPtrFactory<KeyboardController> weak_factory_; |
165 | 162 |
166 // The currently used keyboard position. | 163 // The currently used keyboard position. |
167 gfx::Rect current_keyboard_bounds_; | 164 gfx::Rect current_keyboard_bounds_; |
168 | 165 |
169 static KeyboardController* instance_; | 166 static KeyboardController* instance_; |
170 | 167 |
171 DISALLOW_COPY_AND_ASSIGN(KeyboardController); | 168 DISALLOW_COPY_AND_ASSIGN(KeyboardController); |
172 }; | 169 }; |
173 | 170 |
174 } // namespace keyboard | 171 } // namespace keyboard |
175 | 172 |
176 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 173 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
OLD | NEW |