mirror_window_test_api.cc revision 7dbb3d5cf0c15f500944d211057644d6a2f37371
190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Copyright (c) 2013 The Chromium Authors. All rights reserved.
290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// found in the LICENSE file.
490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "ash/test/mirror_window_test_api.h"
690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
77dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "ash/display/display_controller.h"
890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "ash/display/mirror_window_controller.h"
990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "ash/shell.h"
107d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "ui/aura/root_window_transformer.h"
1190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "ui/gfx/point.h"
1290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
1390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)namespace ash {
1490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)namespace test {
1590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
1690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)const aura::RootWindow* MirrorWindowTestApi::GetRootWindow() const {
177dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  return Shell::GetInstance()->display_controller()->
187dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch      mirror_window_controller()->root_window_.get();
1990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}
2090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
2190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)int MirrorWindowTestApi::GetCurrentCursorType() const {
227dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  return Shell::GetInstance()->display_controller()->
237dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch      mirror_window_controller()->current_cursor_type_;
2490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}
2590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
2690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)const gfx::Point& MirrorWindowTestApi::GetCursorHotPoint() const {
277dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  return Shell::GetInstance()->display_controller()->
287dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch      mirror_window_controller()->hot_point_;
2990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}
3090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
3190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)const aura::Window* MirrorWindowTestApi::GetCursorWindow() const {
327dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  return Shell::GetInstance()->display_controller()->
337dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch      mirror_window_controller()->cursor_window_;
3490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}
3590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
367d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)scoped_ptr<aura::RootWindowTransformer>
377d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)MirrorWindowTestApi::CreateCurrentRootWindowTransformer() const {
387dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  return Shell::GetInstance()->display_controller()->
397dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch      mirror_window_controller()->CreateRootWindowTransformer();
407d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)}
417d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
4290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}  // namespace test
4390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}  // namespace ash
44