mirror_window_test_api.cc revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
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)
75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "ash/display/cursor_window_controller.h"
87dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "ash/display/display_controller.h"
990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "ash/display/mirror_window_controller.h"
1090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "ash/shell.h"
117d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "ui/aura/root_window_transformer.h"
1290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "ui/gfx/point.h"
1390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
1490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)namespace ash {
1590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)namespace test {
1690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
1790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)const aura::RootWindow* MirrorWindowTestApi::GetRootWindow() const {
187dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  return Shell::GetInstance()->display_controller()->
197dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch      mirror_window_controller()->root_window_.get();
2090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}
2190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
2290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)int MirrorWindowTestApi::GetCurrentCursorType() const {
237dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  return Shell::GetInstance()->display_controller()->
245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)      cursor_window_controller()->cursor_type_;
2590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}
2690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
2790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)const gfx::Point& MirrorWindowTestApi::GetCursorHotPoint() const {
287dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  return Shell::GetInstance()->display_controller()->
295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)      cursor_window_controller()->hot_point_;
3090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}
3190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
3290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)const aura::Window* MirrorWindowTestApi::GetCursorWindow() const {
337dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  return Shell::GetInstance()->display_controller()->
345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)      cursor_window_controller()->cursor_window_.get();
3590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}
3690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
377d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)scoped_ptr<aura::RootWindowTransformer>
387d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)MirrorWindowTestApi::CreateCurrentRootWindowTransformer() const {
397dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  return Shell::GetInstance()->display_controller()->
407dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch      mirror_window_controller()->CreateRootWindowTransformer();
417d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)}
427d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
4390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}  // namespace test
4490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}  // namespace ash
45