• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_
6 #define ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_
7 
8 #include "ash/ash_export.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "ui/gfx/display.h"
12 
13 namespace keyboard {
14 class KeyboardController;
15 }
16 
17 namespace ash {
18 
19 namespace test {
20 class VirtualKeyboardWindowControllerTest;
21 }  // namespace test
22 
23 namespace internal {
24 class DisplayInfo;
25 class RootWindowController;
26 
27 // This class maintains the RootWindowController dedicated for
28 // virtual keyboard.
29 class ASH_EXPORT VirtualKeyboardWindowController {
30  public:
31   VirtualKeyboardWindowController();
32   virtual ~VirtualKeyboardWindowController();
33 
34   void ActivateKeyboard(keyboard::KeyboardController* keyboard_controller);
35 
36   // Updates the root window's bounds using |display_info|.
37   // Creates the new root window if one doesn't exist.
38   void UpdateWindow(const DisplayInfo& display_info);
39 
40   // Close the mirror window.
41   void Close();
42 
43  private:
44   friend class test::VirtualKeyboardWindowControllerTest;
45 
46   // Rotates virtual keyboard display by 180 degrees.
47   void FlipDisplay();
48 
root_window_controller_for_test()49   RootWindowController* root_window_controller_for_test() {
50     return root_window_controller_.get();
51   }
52 
53   scoped_ptr<RootWindowController> root_window_controller_;
54 
55   DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardWindowController);
56 };
57 
58 }  // namespace internal
59 }  // namespace ash
60 
61 #endif  // ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_
62