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