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 #include "ash/test/mirror_window_test_api.h" | 5 #include "ash/test/mirror_window_test_api.h" |
6 | 6 |
7 #include "ash/display/cursor_window_controller.h" | 7 #include "ash/display/cursor_window_controller.h" |
8 #include "ash/display/display_controller.h" | 8 #include "ash/display/display_controller.h" |
9 #include "ash/display/mirror_window_controller.h" | 9 #include "ash/display/mirror_window_controller.h" |
10 #include "ash/host/root_window_transformer.h" | 10 #include "ash/host/root_window_transformer.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 int MirrorWindowTestApi::GetCurrentCursorType() const { | 25 int MirrorWindowTestApi::GetCurrentCursorType() const { |
26 return Shell::GetInstance()->display_controller()-> | 26 return Shell::GetInstance()->display_controller()-> |
27 cursor_window_controller()->cursor_type_; | 27 cursor_window_controller()->cursor_type_; |
28 } | 28 } |
29 | 29 |
30 const gfx::Point& MirrorWindowTestApi::GetCursorHotPoint() const { | 30 const gfx::Point& MirrorWindowTestApi::GetCursorHotPoint() const { |
31 return Shell::GetInstance()->display_controller()-> | 31 return Shell::GetInstance()->display_controller()-> |
32 cursor_window_controller()->hot_point_; | 32 cursor_window_controller()->hot_point_; |
33 } | 33 } |
34 | 34 |
| 35 gfx::Point MirrorWindowTestApi::GetCursorHotPointLocationInRootWindow() const { |
| 36 return GetCursorWindow()->GetBoundsInRootWindow().origin() + |
| 37 GetCursorHotPoint().OffsetFromOrigin(); |
| 38 } |
| 39 |
35 const aura::Window* MirrorWindowTestApi::GetCursorWindow() const { | 40 const aura::Window* MirrorWindowTestApi::GetCursorWindow() const { |
36 return Shell::GetInstance()->display_controller()-> | 41 return Shell::GetInstance()->display_controller()-> |
37 cursor_window_controller()->cursor_window_.get(); | 42 cursor_window_controller()->cursor_window_.get(); |
38 } | 43 } |
39 | 44 |
40 gfx::Point MirrorWindowTestApi::GetCursorLocation() const { | 45 gfx::Point MirrorWindowTestApi::GetCursorLocation() const { |
41 gfx::Point point = GetCursorWindow()->GetBoundsInScreen().origin(); | 46 gfx::Point point = GetCursorWindow()->GetBoundsInScreen().origin(); |
42 const gfx::Point hot_point = GetCursorHotPoint(); | 47 const gfx::Point hot_point = GetCursorHotPoint(); |
43 point.Offset(hot_point.x(), hot_point.y()); | 48 point.Offset(hot_point.x(), hot_point.y()); |
44 return point; | 49 return point; |
45 } | 50 } |
46 | 51 |
47 scoped_ptr<RootWindowTransformer> | 52 scoped_ptr<RootWindowTransformer> |
48 MirrorWindowTestApi::CreateCurrentRootWindowTransformer() const { | 53 MirrorWindowTestApi::CreateCurrentRootWindowTransformer() const { |
49 return Shell::GetInstance()->display_controller()-> | 54 return Shell::GetInstance()->display_controller()-> |
50 mirror_window_controller()->CreateRootWindowTransformer(); | 55 mirror_window_controller()->CreateRootWindowTransformer(); |
51 } | 56 } |
52 | 57 |
53 } // namespace test | 58 } // namespace test |
54 } // namespace ash | 59 } // namespace ash |
OLD | NEW |