| 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 #ifndef UI_WM_CORE_NATIVE_CURSOR_MANAGER_H_ | 5 #ifndef UI_WM_CORE_NATIVE_CURSOR_MANAGER_H_ |
| 6 #define UI_WM_CORE_NATIVE_CURSOR_MANAGER_H_ | 6 #define UI_WM_CORE_NATIVE_CURSOR_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "ui/base/cursor/cursor.h" | 9 #include "ui/base/cursor/cursor.h" |
| 10 #include "ui/wm/core/native_cursor_manager_delegate.h" | 10 #include "ui/wm/core/native_cursor_manager_delegate.h" |
| 11 #include "ui/wm/wm_export.h" | 11 #include "ui/wm/wm_export.h" |
| 12 | 12 |
| 13 namespace gfx { | 13 namespace gfx { |
| 14 class Display; | 14 class Display; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace display { |
| 18 using Display = gfx::Display; |
| 19 } |
| 20 |
| 17 namespace wm { | 21 namespace wm { |
| 18 | 22 |
| 19 // Interface where platforms such as Ash or Desktop aura are notified of | 23 // Interface where platforms such as Ash or Desktop aura are notified of |
| 20 // requested changes to cursor state. When requested, implementer should tell | 24 // requested changes to cursor state. When requested, implementer should tell |
| 21 // the CursorManager of any actual state changes performed through the | 25 // the CursorManager of any actual state changes performed through the |
| 22 // delegate. | 26 // delegate. |
| 23 class WM_EXPORT NativeCursorManager { | 27 class WM_EXPORT NativeCursorManager { |
| 24 public: | 28 public: |
| 25 virtual ~NativeCursorManager() {} | 29 virtual ~NativeCursorManager() {} |
| 26 | 30 |
| 27 // A request to set the screen DPI. Can cause changes in the current cursor. | 31 // A request to set the screen DPI. Can cause changes in the current cursor. |
| 28 virtual void SetDisplay( | 32 virtual void SetDisplay(const display::Display& display, |
| 29 const gfx::Display& display, | 33 NativeCursorManagerDelegate* delegate) = 0; |
| 30 NativeCursorManagerDelegate* delegate) = 0; | |
| 31 | 34 |
| 32 // A request to set the cursor to |cursor|. At minimum, implementer should | 35 // A request to set the cursor to |cursor|. At minimum, implementer should |
| 33 // call NativeCursorManagerDelegate::CommitCursor() with whatever cursor is | 36 // call NativeCursorManagerDelegate::CommitCursor() with whatever cursor is |
| 34 // actually used. | 37 // actually used. |
| 35 virtual void SetCursor( | 38 virtual void SetCursor( |
| 36 gfx::NativeCursor cursor, | 39 gfx::NativeCursor cursor, |
| 37 NativeCursorManagerDelegate* delegate) = 0; | 40 NativeCursorManagerDelegate* delegate) = 0; |
| 38 | 41 |
| 39 // A request to set the visibility of the cursor. At minimum, implementer | 42 // A request to set the visibility of the cursor. At minimum, implementer |
| 40 // should call NativeCursorManagerDelegate::CommitVisibility() with whatever | 43 // should call NativeCursorManagerDelegate::CommitVisibility() with whatever |
| (...skipping 11 matching lines...) Expand all Loading... |
| 52 // implementer should call NativeCursorManagerDelegate:: | 55 // implementer should call NativeCursorManagerDelegate:: |
| 53 // CommitMouseEventsEnabled() with whether mouse events are actually enabled. | 56 // CommitMouseEventsEnabled() with whether mouse events are actually enabled. |
| 54 virtual void SetMouseEventsEnabled( | 57 virtual void SetMouseEventsEnabled( |
| 55 bool enabled, | 58 bool enabled, |
| 56 NativeCursorManagerDelegate* delegate) = 0; | 59 NativeCursorManagerDelegate* delegate) = 0; |
| 57 }; | 60 }; |
| 58 | 61 |
| 59 } // namespace wm | 62 } // namespace wm |
| 60 | 63 |
| 61 #endif // UI_WM_CORE_NATIVE_CURSOR_MANAGER_H_ | 64 #endif // UI_WM_CORE_NATIVE_CURSOR_MANAGER_H_ |
| OLD | NEW |