summaryrefslogtreecommitdiffstats
path: root/ash/display/virtual_keyboard_window_controller.h
blob: 6a466599723b4a6da7fac1a88017717e83b27385 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_
#define ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_

#include "ash/ash_export.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "ui/gfx/display.h"

namespace keyboard {
class KeyboardController;
}

namespace ash {

namespace test {
class VirtualKeyboardWindowControllerTest;
}  // namespace test

namespace internal {
class DisplayInfo;
class RootWindowController;

// This class maintains the RootWindowController dedicated for
// virtual keyboard.
class ASH_EXPORT VirtualKeyboardWindowController {
 public:
  VirtualKeyboardWindowController();
  virtual ~VirtualKeyboardWindowController();

  void ActivateKeyboard(keyboard::KeyboardController* keyboard_controller);

  // Updates the root window's bounds using |display_info|.
  // Creates the new root window if one doesn't exist.
  void UpdateWindow(const DisplayInfo& display_info);

  // Close the mirror window.
  void Close();

 private:
  friend class test::VirtualKeyboardWindowControllerTest;

  // Rotates virtual keyboard display by 180 degrees.
  void FlipDisplay();

  RootWindowController* root_window_controller_for_test() {
    return root_window_controller_.get();
  }

  scoped_ptr<RootWindowController> root_window_controller_;

  DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardWindowController);
};

}  // namespace internal
}  // namespace ash

#endif  // ASH_DISPLAY_VIRTUAL_KEYBOARD_WINDOW_CONTROLLER_H_