mazda@chromium.org | 44e64a6 | 2012-09-21 04:21:11 | [diff] [blame] | 1 | // Copyright (c) 2012 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/cursor_manager_test_api.h" |
| 6 | |
erg@chromium.org | c0ff034 | 2013-02-27 00:41:29 | [diff] [blame] | 7 | #include "ash/shell.h" |
| 8 | #include "ash/test/shell_test_api.h" |
| 9 | #include "ash/wm/ash_native_cursor_manager.h" |
mazda@chromium.org | 44e64a6 | 2012-09-21 04:21:11 | [diff] [blame] | 10 | #include "ash/wm/image_cursors.h" |
oshima@chromium.org | cf562b7 | 2013-03-14 20:22:31 | [diff] [blame] | 11 | #include "ui/gfx/display.h" |
ben@chromium.org | ee3ed10 | 2014-03-11 22:02:01 | [diff] [blame] | 12 | #include "ui/wm/core/cursor_manager.h" |
mazda@chromium.org | 44e64a6 | 2012-09-21 04:21:11 | [diff] [blame] | 13 | |
| 14 | namespace ash { |
| 15 | namespace test { |
| 16 | |
erg@chromium.org | c0ff034 | 2013-02-27 00:41:29 | [diff] [blame] | 17 | CursorManagerTestApi::CursorManagerTestApi( |
ben@chromium.org | e319c7e | 2014-03-14 19:56:14 | [diff] [blame] | 18 | wm::CursorManager* cursor_manager) |
mazda@chromium.org | 44e64a6 | 2012-09-21 04:21:11 | [diff] [blame] | 19 | : cursor_manager_(cursor_manager) { |
| 20 | } |
| 21 | |
| 22 | CursorManagerTestApi::~CursorManagerTestApi() { |
| 23 | } |
| 24 | |
tdanderson@chromium.org | fdb0c4b | 2013-12-13 08:28:41 | [diff] [blame] | 25 | // TODO(tdanderson): CursorManagerTestApi may no longer be needed. |
yoshiki@chromium.org | 2a08226 | 2013-08-26 12:40:22 | [diff] [blame] | 26 | ui::CursorSetType CursorManagerTestApi::GetCurrentCursorSet() const { |
tdanderson@chromium.org | fdb0c4b | 2013-12-13 08:28:41 | [diff] [blame] | 27 | return cursor_manager_->GetCursorSet(); |
yoshiki@chromium.org | 2a08226 | 2013-08-26 12:40:22 | [diff] [blame] | 28 | } |
| 29 | |
mazda@chromium.org | 166ccde | 2012-12-19 16:43:53 | [diff] [blame] | 30 | gfx::NativeCursor CursorManagerTestApi::GetCurrentCursor() const { |
tdanderson@chromium.org | fdb0c4b | 2013-12-13 08:28:41 | [diff] [blame] | 31 | return cursor_manager_->GetCursor(); |
mazda@chromium.org | 44e64a6 | 2012-09-21 04:21:11 | [diff] [blame] | 32 | } |
| 33 | |
oshima@chromium.org | 9ad32ee6 | 2014-04-23 22:00:25 | [diff] [blame^] | 34 | gfx::Display::Rotation |
| 35 | CursorManagerTestApi::GetCurrentCursorRotation() const { |
erg@chromium.org | c0ff034 | 2013-02-27 00:41:29 | [diff] [blame] | 36 | return ShellTestApi(Shell::GetInstance()).ash_native_cursor_manager()-> |
oshima@chromium.org | 9ad32ee6 | 2014-04-23 22:00:25 | [diff] [blame^] | 37 | image_cursors_->GetRotation(); |
| 38 | } |
| 39 | |
| 40 | float |
| 41 | CursorManagerTestApi::GetCurrentCursorScale() const { |
| 42 | return ShellTestApi(Shell::GetInstance()).ash_native_cursor_manager()-> |
| 43 | image_cursors_->GetScale(); |
mazda@chromium.org | 44e64a6 | 2012-09-21 04:21:11 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | } // namespace test |
| 47 | } // namespace ash |