| 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 "ui/aura/window_observer.h" | 10 #include "ui/aura/window_observer.h" |
| 11 #include "ui/base/ime/input_method_observer.h" | 11 #include "ui/base/ime/input_method_observer.h" |
| 12 #include "ui/keyboard/keyboard_export.h" | 12 #include "ui/keyboard/keyboard_export.h" |
| 13 | 13 |
| 14 namespace aura { | 14 namespace aura { |
| 15 class Window; | 15 class Window; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace ui { | 18 namespace ui { |
| 19 class InputMethod; |
| 19 class TextInputClient; | 20 class TextInputClient; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace keyboard { | 23 namespace keyboard { |
| 23 | 24 |
| 24 class KeyboardControllerProxy; | 25 class KeyboardControllerProxy; |
| 26 class KeyboardLayoutManager; |
| 25 | 27 |
| 26 // Provides control of the virtual keyboard, including providing a container, | 28 // Provides control of the virtual keyboard, including providing a container |
| 27 // managing object lifetimes and controlling visibility. | 29 // and controlling visibility. |
| 28 class KEYBOARD_EXPORT KeyboardController : public ui::InputMethodObserver, | 30 class KEYBOARD_EXPORT KeyboardController : public ui::InputMethodObserver, |
| 29 public aura::WindowObserver { | 31 public aura::WindowObserver { |
| 30 public: | 32 public: |
| 31 // Takes ownership of |proxy|. | 33 // Takes ownership of |proxy|. |
| 32 explicit KeyboardController(KeyboardControllerProxy* proxy); | 34 explicit KeyboardController(KeyboardControllerProxy* proxy); |
| 33 virtual ~KeyboardController(); | 35 virtual ~KeyboardController(); |
| 34 | 36 |
| 35 // Returns the container for the keyboard, which is then owned by the caller. | 37 // Returns the container for the keyboard, which is then owned by the caller. |
| 36 // It is the responsibility of the caller to Show() the returned window. | 38 // It is the responsibility of the caller to Show() the returned window. |
| 37 aura::Window* GetContainerWindow(); | 39 aura::Window* GetContainerWindow(); |
| 38 | 40 |
| 39 // InputMethodObserver overrides | 41 // InputMethodObserver overrides |
| 40 virtual void OnTextInputStateChanged( | 42 virtual void OnTextInputStateChanged( |
| 41 const ui::TextInputClient* client) OVERRIDE; | 43 const ui::TextInputClient* client) OVERRIDE; |
| 42 | 44 |
| 43 private: | 45 private: |
| 44 // aura::WindowObserver overrides | 46 // aura::WindowObserver overrides |
| 45 virtual void OnWindowParentChanged(aura::Window* window, | 47 virtual void OnWindowParentChanged(aura::Window* window, |
| 46 aura::Window* parent) OVERRIDE; | 48 aura::Window* parent) OVERRIDE; |
| 47 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 49 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
| 48 | 50 |
| 49 scoped_ptr<KeyboardControllerProxy> proxy_; | 51 scoped_ptr<KeyboardControllerProxy> proxy_; |
| 50 aura::Window* container_; | 52 KeyboardLayoutManager* layout_manager_; |
| 53 ui::InputMethod* input_method_; |
| 51 | 54 |
| 52 DISALLOW_COPY_AND_ASSIGN(KeyboardController); | 55 DISALLOW_COPY_AND_ASSIGN(KeyboardController); |
| 53 }; | 56 }; |
| 54 | 57 |
| 55 } // namespace keyboard | 58 } // namespace keyboard |
| 56 | 59 |
| 57 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ | 60 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_H_ |
| OLD | NEW |