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 <memory> |
| 9 |
8 #include "base/event_types.h" | 10 #include "base/event_types.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
12 #include "ui/aura/window_observer.h" | 13 #include "ui/aura/window_observer.h" |
13 #include "ui/base/ime/input_method_observer.h" | 14 #include "ui/base/ime/input_method_observer.h" |
14 #include "ui/base/ime/text_input_type.h" | 15 #include "ui/base/ime/text_input_type.h" |
15 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
16 #include "ui/keyboard/keyboard_export.h" | 17 #include "ui/keyboard/keyboard_export.h" |
17 | 18 |
18 namespace aura { | 19 namespace aura { |
19 class Window; | 20 class Window; |
20 } | 21 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 void ShowKeyboardInternal(); | 142 void ShowKeyboardInternal(); |
142 | 143 |
143 // Returns true if keyboard is scheduled to hide. | 144 // Returns true if keyboard is scheduled to hide. |
144 bool WillHideKeyboard() const; | 145 bool WillHideKeyboard() const; |
145 | 146 |
146 // Called when show and hide animation finished successfully. If the animation | 147 // Called when show and hide animation finished successfully. If the animation |
147 // is aborted, it won't be called. | 148 // is aborted, it won't be called. |
148 void ShowAnimationFinished(); | 149 void ShowAnimationFinished(); |
149 void HideAnimationFinished(); | 150 void HideAnimationFinished(); |
150 | 151 |
151 scoped_ptr<KeyboardUI> ui_; | 152 std::unique_ptr<KeyboardUI> ui_; |
152 scoped_ptr<aura::Window> container_; | 153 std::unique_ptr<aura::Window> container_; |
153 // CallbackAnimationObserver should destructed before container_ because it | 154 // CallbackAnimationObserver should destructed before container_ because it |
154 // uses container_'s animator. | 155 // uses container_'s animator. |
155 scoped_ptr<CallbackAnimationObserver> animation_observer_; | 156 std::unique_ptr<CallbackAnimationObserver> animation_observer_; |
156 | 157 |
157 ui::InputMethod* input_method_; | 158 ui::InputMethod* input_method_; |
158 bool keyboard_visible_; | 159 bool keyboard_visible_; |
159 bool show_on_resize_; | 160 bool show_on_resize_; |
160 bool lock_keyboard_; | 161 bool lock_keyboard_; |
161 KeyboardMode keyboard_mode_; | 162 KeyboardMode keyboard_mode_; |
162 ui::TextInputType type_; | 163 ui::TextInputType type_; |
163 | 164 |
164 base::ObserverList<KeyboardControllerObserver> observer_list_; | 165 base::ObserverList<KeyboardControllerObserver> observer_list_; |
165 | 166 |
166 // The currently used keyboard position. | 167 // The currently used keyboard position. |
167 gfx::Rect current_keyboard_bounds_; | 168 gfx::Rect current_keyboard_bounds_; |
168 | 169 |
169 static KeyboardController* instance_; | 170 static KeyboardController* instance_; |
170 | 171 |
171 base::WeakPtrFactory<KeyboardController> weak_factory_; | 172 base::WeakPtrFactory<KeyboardController> weak_factory_; |
172 | 173 |
173 DISALLOW_COPY_AND_ASSIGN(KeyboardController); | 174 DISALLOW_COPY_AND_ASSIGN(KeyboardController); |
174 }; | 175 }; |
175 | 176 |
176 } // namespace keyboard | 177 } // namespace keyboard |
177 | 178 |
178 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 179 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
OLD | NEW |