| 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 "ui/wm/core/cursor_manager.h" | 5 #include "ui/wm/core/cursor_manager.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "ui/aura/client/cursor_client_observer.h" | 9 #include "ui/aura/client/cursor_client_observer.h" |
| 10 #include "ui/aura/test/aura_test_base.h" | 10 #include "ui/aura/test/aura_test_base.h" |
| 11 #include "ui/wm/core/native_cursor_manager.h" | 11 #include "ui/wm/core/native_cursor_manager.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 class TestingCursorManager : public wm::NativeCursorManager { | 15 class TestingCursorManager : public wm::NativeCursorManager { |
| 16 public: | 16 public: |
| 17 // Overridden from wm::NativeCursorManager: | 17 // Overridden from wm::NativeCursorManager: |
| 18 void SetDisplay(const gfx::Display& display, | 18 void SetDisplay(const display::Display& display, |
| 19 wm::NativeCursorManagerDelegate* delegate) override {} | 19 wm::NativeCursorManagerDelegate* delegate) override {} |
| 20 | 20 |
| 21 void SetCursor(gfx::NativeCursor cursor, | 21 void SetCursor(gfx::NativeCursor cursor, |
| 22 wm::NativeCursorManagerDelegate* delegate) override { | 22 wm::NativeCursorManagerDelegate* delegate) override { |
| 23 delegate->CommitCursor(cursor); | 23 delegate->CommitCursor(cursor); |
| 24 } | 24 } |
| 25 | 25 |
| 26 void SetVisibility(bool visible, | 26 void SetVisibility(bool visible, |
| 27 wm::NativeCursorManagerDelegate* delegate) override { | 27 wm::NativeCursorManagerDelegate* delegate) override { |
| 28 delegate->CommitVisibility(visible); | 28 delegate->CommitVisibility(visible); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // This block validates that the cursor is visible initially. It then | 352 // This block validates that the cursor is visible initially. It then |
| 353 // performs normal cursor visibility operations. | 353 // performs normal cursor visibility operations. |
| 354 { | 354 { |
| 355 wm::CursorManager cursor_manager3( | 355 wm::CursorManager cursor_manager3( |
| 356 scoped_ptr<wm::NativeCursorManager>(new TestingCursorManager)); | 356 scoped_ptr<wm::NativeCursorManager>(new TestingCursorManager)); |
| 357 EXPECT_TRUE(cursor_manager3.IsCursorVisible()); | 357 EXPECT_TRUE(cursor_manager3.IsCursorVisible()); |
| 358 cursor_manager3.HideCursor(); | 358 cursor_manager3.HideCursor(); |
| 359 EXPECT_FALSE(cursor_manager3.IsCursorVisible()); | 359 EXPECT_FALSE(cursor_manager3.IsCursorVisible()); |
| 360 } | 360 } |
| 361 } | 361 } |
| OLD | NEW |