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_CURSOR_MANAGER_H_ | 5 #ifndef UI_WM_CORE_CURSOR_MANAGER_H_ |
6 #define UI_WM_CORE_CURSOR_MANAGER_H_ | 6 #define UI_WM_CORE_CURSOR_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 // Resets the last visibility state, etc. Currently only called by tests. | 43 // Resets the last visibility state, etc. Currently only called by tests. |
44 static void ResetCursorVisibilityStateForTest(); | 44 static void ResetCursorVisibilityStateForTest(); |
45 | 45 |
46 // Overridden from aura::client::CursorClient: | 46 // Overridden from aura::client::CursorClient: |
47 void SetCursor(gfx::NativeCursor) override; | 47 void SetCursor(gfx::NativeCursor) override; |
48 gfx::NativeCursor GetCursor() const override; | 48 gfx::NativeCursor GetCursor() const override; |
49 void ShowCursor() override; | 49 void ShowCursor() override; |
50 void HideCursor() override; | 50 void HideCursor() override; |
51 bool IsCursorVisible() const override; | 51 bool IsCursorVisible() const override; |
52 void SetCursorSet(ui::CursorSetType cursor_set) override; | 52 void SetCursorSize(ui::CursorSize cursor_size) override; |
53 ui::CursorSetType GetCursorSet() const override; | 53 ui::CursorSize GetCursorSize() const override; |
54 void EnableMouseEvents() override; | 54 void EnableMouseEvents() override; |
55 void DisableMouseEvents() override; | 55 void DisableMouseEvents() override; |
56 bool IsMouseEventsEnabled() const override; | 56 bool IsMouseEventsEnabled() const override; |
57 void SetDisplay(const display::Display& display) override; | 57 void SetDisplay(const display::Display& display) override; |
58 const display::Display& GetDisplay() const override; | 58 const display::Display& GetDisplay() const override; |
59 void LockCursor() override; | 59 void LockCursor() override; |
60 void UnlockCursor() override; | 60 void UnlockCursor() override; |
61 bool IsCursorLocked() const override; | 61 bool IsCursorLocked() const override; |
62 void AddObserver(aura::client::CursorClientObserver* observer) override; | 62 void AddObserver(aura::client::CursorClientObserver* observer) override; |
63 void RemoveObserver(aura::client::CursorClientObserver* observer) override; | 63 void RemoveObserver(aura::client::CursorClientObserver* observer) override; |
64 bool ShouldHideCursorOnKeyEvent(const ui::KeyEvent& event) const override; | 64 bool ShouldHideCursorOnKeyEvent(const ui::KeyEvent& event) const override; |
65 | 65 |
66 private: | 66 private: |
67 // Overridden from NativeCursorManagerDelegate: | 67 // Overridden from NativeCursorManagerDelegate: |
68 void CommitCursor(gfx::NativeCursor cursor) override; | 68 void CommitCursor(gfx::NativeCursor cursor) override; |
69 void CommitVisibility(bool visible) override; | 69 void CommitVisibility(bool visible) override; |
70 void CommitCursorSet(ui::CursorSetType cursor_set) override; | 70 void CommitCursorSize(ui::CursorSize cursor_size) override; |
71 void CommitMouseEventsEnabled(bool enabled) override; | 71 void CommitMouseEventsEnabled(bool enabled) override; |
72 | 72 |
73 std::unique_ptr<NativeCursorManager> delegate_; | 73 std::unique_ptr<NativeCursorManager> delegate_; |
74 | 74 |
75 // Display where the cursor is located. | 75 // Display where the cursor is located. |
76 display::Display display_; | 76 display::Display display_; |
77 | 77 |
78 // Number of times LockCursor() has been invoked without a corresponding | 78 // Number of times LockCursor() has been invoked without a corresponding |
79 // UnlockCursor(). | 79 // UnlockCursor(). |
80 int cursor_lock_count_; | 80 int cursor_lock_count_; |
(...skipping 11 matching lines...) Expand all Loading... |
92 // CursorManager instance is created it gets populated with the correct | 92 // CursorManager instance is created it gets populated with the correct |
93 // cursor visibility state. | 93 // cursor visibility state. |
94 static bool last_cursor_visibility_state_; | 94 static bool last_cursor_visibility_state_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(CursorManager); | 96 DISALLOW_COPY_AND_ASSIGN(CursorManager); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace wm | 99 } // namespace wm |
100 | 100 |
101 #endif // UI_WM_CORE_CURSOR_MANAGER_H_ | 101 #endif // UI_WM_CORE_CURSOR_MANAGER_H_ |
OLD | NEW |