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