• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "ash/test/mirror_window_test_api.h"
6 
7 #include "ash/display/cursor_window_controller.h"
8 #include "ash/display/display_controller.h"
9 #include "ash/display/mirror_window_controller.h"
10 #include "ash/host/root_window_transformer.h"
11 #include "ash/shell.h"
12 #include "ui/gfx/point.h"
13 
14 namespace ash {
15 namespace test {
16 
GetHost() const17 const aura::WindowTreeHost* MirrorWindowTestApi::GetHost() const {
18   aura::Window* window = Shell::GetInstance()
19                              ->display_controller()
20                              ->mirror_window_controller()
21                              ->GetWindow();
22   return window ? window->GetHost() : NULL;
23 }
24 
GetCurrentCursorType() const25 int MirrorWindowTestApi::GetCurrentCursorType() const {
26   return Shell::GetInstance()->display_controller()->
27       cursor_window_controller()->cursor_type_;
28 }
29 
GetCursorHotPoint() const30 const gfx::Point& MirrorWindowTestApi::GetCursorHotPoint() const {
31   return Shell::GetInstance()->display_controller()->
32       cursor_window_controller()->hot_point_;
33 }
34 
GetCursorWindow() const35 const aura::Window* MirrorWindowTestApi::GetCursorWindow() const {
36   return Shell::GetInstance()->display_controller()->
37       cursor_window_controller()->cursor_window_.get();
38 }
39 
40 scoped_ptr<RootWindowTransformer>
CreateCurrentRootWindowTransformer() const41 MirrorWindowTestApi::CreateCurrentRootWindowTransformer() const {
42   return Shell::GetInstance()->display_controller()->
43       mirror_window_controller()->CreateRootWindowTransformer();
44 }
45 
46 }  // namespace test
47 }  // namespace ash
48