OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef ASH_WM_ASH_NATIVE_CURSOR_MANAGER_H_ | 5 #ifndef ASH_WM_ASH_NATIVE_CURSOR_MANAGER_H_ |
6 #define ASH_WM_ASH_NATIVE_CURSOR_MANAGER_H_ | 6 #define ASH_WM_ASH_NATIVE_CURSOR_MANAGER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 | 27 |
28 // This does the ash-specific setting of cursor details like cursor | 28 // This does the ash-specific setting of cursor details like cursor |
29 // visibility. It communicates back with the CursorManager through the | 29 // visibility. It communicates back with the CursorManager through the |
30 // NativeCursorManagerDelegate interface, which receives messages about what | 30 // NativeCursorManagerDelegate interface, which receives messages about what |
31 // changes were acted on. | 31 // changes were acted on. |
32 class ASH_EXPORT AshNativeCursorManager | 32 class ASH_EXPORT AshNativeCursorManager |
33 : public ::wm::NativeCursorManager { | 33 : public ::wm::NativeCursorManager { |
34 public: | 34 public: |
35 AshNativeCursorManager(); | 35 AshNativeCursorManager(); |
36 virtual ~AshNativeCursorManager(); | 36 ~AshNativeCursorManager() override; |
37 | 37 |
38 // Toggle native cursor enabled/disabled. | 38 // Toggle native cursor enabled/disabled. |
39 // The native cursor is enabled by default. When disabled, we hide the native | 39 // The native cursor is enabled by default. When disabled, we hide the native |
40 // cursor regardless of visibility state, and let CursorWindowManager draw | 40 // cursor regardless of visibility state, and let CursorWindowManager draw |
41 // the cursor. | 41 // the cursor. |
42 void SetNativeCursorEnabled(bool enabled); | 42 void SetNativeCursorEnabled(bool enabled); |
43 | 43 |
44 private: | 44 private: |
45 friend class test::CursorManagerTestApi; | 45 friend class test::CursorManagerTestApi; |
46 | 46 |
47 // Overridden from ::wm::NativeCursorManager: | 47 // Overridden from ::wm::NativeCursorManager: |
48 virtual void SetDisplay( | 48 void SetDisplay(const gfx::Display& display, |
49 const gfx::Display& display, | 49 ::wm::NativeCursorManagerDelegate* delegate) override; |
50 ::wm::NativeCursorManagerDelegate* delegate) override; | 50 void SetCursor(gfx::NativeCursor cursor, |
51 virtual void SetCursor( | 51 ::wm::NativeCursorManagerDelegate* delegate) override; |
52 gfx::NativeCursor cursor, | 52 void SetVisibility(bool visible, |
53 ::wm::NativeCursorManagerDelegate* delegate) override; | 53 ::wm::NativeCursorManagerDelegate* delegate) override; |
54 virtual void SetVisibility( | 54 void SetCursorSet(ui::CursorSetType cursor_set, |
55 bool visible, | 55 ::wm::NativeCursorManagerDelegate* delegate) override; |
56 ::wm::NativeCursorManagerDelegate* delegate) override; | 56 void SetMouseEventsEnabled( |
57 virtual void SetCursorSet( | |
58 ui::CursorSetType cursor_set, | |
59 ::wm::NativeCursorManagerDelegate* delegate) override; | |
60 virtual void SetMouseEventsEnabled( | |
61 bool enabled, | 57 bool enabled, |
62 ::wm::NativeCursorManagerDelegate* delegate) override; | 58 ::wm::NativeCursorManagerDelegate* delegate) override; |
63 | 59 |
64 // The cursor location where the cursor was disabled. | 60 // The cursor location where the cursor was disabled. |
65 gfx::Point disabled_cursor_location_; | 61 gfx::Point disabled_cursor_location_; |
66 | 62 |
67 bool native_cursor_enabled_; | 63 bool native_cursor_enabled_; |
68 | 64 |
69 scoped_ptr<ui::ImageCursors> image_cursors_; | 65 scoped_ptr<ui::ImageCursors> image_cursors_; |
70 | 66 |
71 DISALLOW_COPY_AND_ASSIGN(AshNativeCursorManager); | 67 DISALLOW_COPY_AND_ASSIGN(AshNativeCursorManager); |
72 }; | 68 }; |
73 | 69 |
74 } // namespace ash | 70 } // namespace ash |
75 | 71 |
76 #endif // ASH_WM_ASH_NATIVE_CURSOR_MANAGER_H_ | 72 #endif // ASH_WM_ASH_NATIVE_CURSOR_MANAGER_H_ |
OLD | NEW |