OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_ | 5 #ifndef ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_ |
6 #define ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_ | 6 #define ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/shell_observer.h" | 9 #include "ash/shell_observer.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "ui/gfx/display.h" | 12 #include "ui/gfx/display.h" |
13 | 13 |
14 namespace keyboard { | 14 namespace keyboard { |
15 class KeyboardController; | 15 class KeyboardController; |
16 } | 16 } |
17 | 17 |
| 18 namespace ui { |
| 19 class ContextFactory; |
| 20 } |
| 21 |
18 namespace ash { | 22 namespace ash { |
19 class DisplayInfo; | 23 class DisplayInfo; |
20 class RootWindowController; | 24 class RootWindowController; |
21 | 25 |
22 namespace test { | 26 namespace test { |
23 class VirtualKeyboardWindowControllerTest; | 27 class VirtualKeyboardWindowControllerTest; |
24 } // namespace test | 28 } // namespace test |
25 | 29 |
26 // This class maintains the RootWindowController dedicated for | 30 // This class maintains the RootWindowController dedicated for |
27 // virtual keyboard. | 31 // virtual keyboard. |
28 class ASH_EXPORT VirtualKeyboardWindowController : public ShellObserver { | 32 class ASH_EXPORT VirtualKeyboardWindowController : public ShellObserver { |
29 public: | 33 public: |
30 VirtualKeyboardWindowController(); | 34 explicit VirtualKeyboardWindowController(ui::ContextFactory* context_factory); |
31 virtual ~VirtualKeyboardWindowController(); | 35 virtual ~VirtualKeyboardWindowController(); |
32 | 36 |
33 void ActivateKeyboard(keyboard::KeyboardController* keyboard_controller); | 37 void ActivateKeyboard(keyboard::KeyboardController* keyboard_controller); |
34 | 38 |
35 // Updates the root window's bounds using |display_info|. | 39 // Updates the root window's bounds using |display_info|. |
36 // Creates the new root window if one doesn't exist. | 40 // Creates the new root window if one doesn't exist. |
37 void UpdateWindow(const DisplayInfo& display_info); | 41 void UpdateWindow(const DisplayInfo& display_info); |
38 | 42 |
39 // Close the mirror window. | 43 // Close the mirror window. |
40 void Close(); | 44 void Close(); |
41 | 45 |
42 // ShellObserver: | 46 // ShellObserver: |
43 virtual void OnMaximizeModeStarted() OVERRIDE; | 47 virtual void OnMaximizeModeStarted() OVERRIDE; |
44 virtual void OnMaximizeModeEnded() OVERRIDE; | 48 virtual void OnMaximizeModeEnded() OVERRIDE; |
45 | 49 |
46 private: | 50 private: |
47 friend class test::VirtualKeyboardWindowControllerTest; | 51 friend class test::VirtualKeyboardWindowControllerTest; |
48 | 52 |
49 // Rotates virtual keyboard display by 180 degrees. | 53 // Rotates virtual keyboard display by 180 degrees. |
50 void FlipDisplay(); | 54 void FlipDisplay(); |
51 | 55 |
52 RootWindowController* root_window_controller_for_test() { | 56 RootWindowController* root_window_controller_for_test() { |
53 return root_window_controller_.get(); | 57 return root_window_controller_.get(); |
54 } | 58 } |
55 | 59 |
| 60 ui::ContextFactory* context_factory_; |
| 61 |
56 scoped_ptr<RootWindowController> root_window_controller_; | 62 scoped_ptr<RootWindowController> root_window_controller_; |
57 | 63 |
58 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardWindowController); | 64 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardWindowController); |
59 }; | 65 }; |
60 | 66 |
61 } // namespace ash | 67 } // namespace ash |
62 | 68 |
63 #endif // ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_ | 69 #endif // ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_ |
OLD | NEW |