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_CURSOR_MANAGER_H_ | 5 #ifndef ASH_WM_CURSOR_MANAGER_H_ |
6 #define ASH_WM_CURSOR_MANAGER_H_ | 6 #define ASH_WM_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 12 matching lines...) Expand all Loading... |
23 // This class controls the visibility and the type of the cursor. | 23 // This class controls the visibility and the type of the cursor. |
24 // The cursor type can be locked so that the type stays the same | 24 // The cursor type can be locked so that the type stays the same |
25 // until it's unlocked. | 25 // until it's unlocked. |
26 class ASH_EXPORT CursorManager : public aura::client::CursorClient { | 26 class ASH_EXPORT CursorManager : public aura::client::CursorClient { |
27 public: | 27 public: |
28 CursorManager(); | 28 CursorManager(); |
29 virtual ~CursorManager(); | 29 virtual ~CursorManager(); |
30 | 30 |
31 bool is_cursor_locked() const { return cursor_lock_count_ > 0; } | 31 bool is_cursor_locked() const { return cursor_lock_count_ > 0; } |
32 | 32 |
33 // Shows or hides the cursor. | |
34 bool cursor_visible() const { return cursor_visible_; } | |
35 | |
36 // Overridden from aura::client::CursorClient: | 33 // Overridden from aura::client::CursorClient: |
37 virtual void SetCursor(gfx::NativeCursor) OVERRIDE; | 34 virtual void SetCursor(gfx::NativeCursor) OVERRIDE; |
38 virtual void ShowCursor(bool show) OVERRIDE; | 35 virtual void ShowCursor(bool show) OVERRIDE; |
39 virtual bool IsCursorVisible() const OVERRIDE; | 36 virtual bool IsCursorVisible() const OVERRIDE; |
40 virtual void SetDeviceScaleFactor(float device_scale_factor) OVERRIDE; | 37 virtual void SetDeviceScaleFactor(float device_scale_factor) OVERRIDE; |
41 virtual void LockCursor() OVERRIDE; | 38 virtual void LockCursor() OVERRIDE; |
42 virtual void UnlockCursor() OVERRIDE; | 39 virtual void UnlockCursor() OVERRIDE; |
43 | 40 |
44 private: | 41 private: |
45 friend class test::CursorManagerTestApi; | 42 friend class test::CursorManagerTestApi; |
(...skipping 26 matching lines...) Expand all Loading... |
72 gfx::NativeCursor current_cursor_; | 69 gfx::NativeCursor current_cursor_; |
73 | 70 |
74 scoped_ptr<ImageCursors> image_cursors_; | 71 scoped_ptr<ImageCursors> image_cursors_; |
75 | 72 |
76 DISALLOW_COPY_AND_ASSIGN(CursorManager); | 73 DISALLOW_COPY_AND_ASSIGN(CursorManager); |
77 }; | 74 }; |
78 | 75 |
79 } // namespace ash | 76 } // namespace ash |
80 | 77 |
81 #endif // UI_AURA_CURSOR_MANAGER_H_ | 78 #endif // UI_AURA_CURSOR_MANAGER_H_ |
OLD | NEW |