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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "ui/aura/window_observer.h" | 11 #include "ui/aura/window_observer.h" |
12 #include "ui/base/ime/input_method_observer.h" | 12 #include "ui/base/ime/input_method_observer.h" |
13 #include "ui/keyboard/keyboard_export.h" | 13 #include "ui/keyboard/keyboard_export.h" |
14 | 14 |
15 namespace aura { | 15 namespace aura { |
16 class Window; | 16 class Window; |
17 } | 17 } |
18 namespace gfx { | 18 namespace gfx { |
19 class Rect; | 19 class Rect; |
20 } | 20 } |
21 namespace ui { | 21 namespace ui { |
22 class InputMethod; | 22 class InputMethod; |
23 class TextInputClient; | 23 class TextInputClient; |
24 } | 24 } |
25 | 25 |
26 namespace keyboard { | 26 namespace keyboard { |
27 | 27 |
28 extern const int kHideKeyboardDelayMs; | |
29 | |
28 class KeyboardControllerObserver; | 30 class KeyboardControllerObserver; |
29 class KeyboardControllerProxy; | 31 class KeyboardControllerProxy; |
30 class KeyboardLayoutManager; | 32 class KeyboardLayoutManager; |
31 | 33 |
32 // Provides control of the virtual keyboard, including providing a container | 34 // Provides control of the virtual keyboard, including providing a container |
33 // and controlling visibility. | 35 // and controlling visibility. |
34 class KEYBOARD_EXPORT KeyboardController : public ui::InputMethodObserver, | 36 class KEYBOARD_EXPORT KeyboardController : public ui::InputMethodObserver, |
35 public aura::WindowObserver { | 37 public aura::WindowObserver { |
36 public: | 38 public: |
37 // Takes ownership of |proxy|. | 39 // Takes ownership of |proxy|. |
(...skipping 16 matching lines...) Expand all Loading... | |
54 virtual void OnWindowHierarchyChanged( | 56 virtual void OnWindowHierarchyChanged( |
55 const HierarchyChangeParams& params) OVERRIDE; | 57 const HierarchyChangeParams& params) OVERRIDE; |
56 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 58 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
57 | 59 |
58 // InputMethodObserver overrides | 60 // InputMethodObserver overrides |
59 virtual void OnTextInputStateChanged( | 61 virtual void OnTextInputStateChanged( |
60 const ui::TextInputClient* client) OVERRIDE; | 62 const ui::TextInputClient* client) OVERRIDE; |
61 virtual void OnInputMethodDestroyed( | 63 virtual void OnInputMethodDestroyed( |
62 const ui::InputMethod* input_method) OVERRIDE; | 64 const ui::InputMethod* input_method) OVERRIDE; |
63 | 65 |
66 // Hides virtual keyboard and notifies observer bounds change. | |
67 // This functions should be called with a delay to avoid keyboard flicking | |
kevers
2013/08/26 15:50:18
keyboard flicking --> layout flicker
bshe
2013/08/26 18:39:17
Done.
| |
68 // when the focus of input feild quickly change. | |
sadrul
2013/08/26 17:30:31
*field
bshe
2013/08/26 18:39:17
Done.
| |
69 void HideKeyboard(); | |
70 | |
64 scoped_ptr<KeyboardControllerProxy> proxy_; | 71 scoped_ptr<KeyboardControllerProxy> proxy_; |
65 aura::Window* container_; | 72 aura::Window* container_; |
66 ui::InputMethod* input_method_; | 73 ui::InputMethod* input_method_; |
74 bool keyboard_visible_; | |
75 base::WeakPtrFactory<KeyboardController> weak_factory_; | |
67 | 76 |
68 ObserverList<KeyboardControllerObserver> observer_list_; | 77 ObserverList<KeyboardControllerObserver> observer_list_; |
69 | 78 |
70 DISALLOW_COPY_AND_ASSIGN(KeyboardController); | 79 DISALLOW_COPY_AND_ASSIGN(KeyboardController); |
71 }; | 80 }; |
72 | 81 |
73 } // namespace keyboard | 82 } // namespace keyboard |
74 | 83 |
75 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 84 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
OLD | NEW |