| 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_VIEWS_COREWM_CURSOR_MANAGER_H_ | 5 #ifndef UI_VIEWS_COREWM_CURSOR_MANAGER_H_ |
| 6 #define UI_VIEWS_COREWM_CURSOR_MANAGER_H_ | 6 #define UI_VIEWS_COREWM_CURSOR_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 virtual bool IsMouseEventsEnabled() const OVERRIDE; | 54 virtual bool IsMouseEventsEnabled() const OVERRIDE; |
| 55 virtual void SetDisplay(const gfx::Display& display) OVERRIDE; | 55 virtual void SetDisplay(const gfx::Display& display) OVERRIDE; |
| 56 virtual void LockCursor() OVERRIDE; | 56 virtual void LockCursor() OVERRIDE; |
| 57 virtual void UnlockCursor() OVERRIDE; | 57 virtual void UnlockCursor() OVERRIDE; |
| 58 virtual bool IsCursorLocked() const OVERRIDE; | 58 virtual bool IsCursorLocked() const OVERRIDE; |
| 59 virtual void AddObserver( | 59 virtual void AddObserver( |
| 60 aura::client::CursorClientObserver* observer) OVERRIDE; | 60 aura::client::CursorClientObserver* observer) OVERRIDE; |
| 61 virtual void RemoveObserver( | 61 virtual void RemoveObserver( |
| 62 aura::client::CursorClientObserver* observer) OVERRIDE; | 62 aura::client::CursorClientObserver* observer) OVERRIDE; |
| 63 | 63 |
| 64 // Toggles native cursor enabled/disabled. |
| 65 // The native cursor is enabled by default. |
| 66 // When disabled, native cursor is hidden even when cursor is visible. |
| 67 void SetNativeCursorEnabled(bool enabled); |
| 68 |
| 64 private: | 69 private: |
| 65 // Overridden from NativeCursorManagerDelegate: | 70 // Overridden from NativeCursorManagerDelegate: |
| 66 virtual void CommitCursor(gfx::NativeCursor cursor) OVERRIDE; | 71 virtual void CommitCursor(gfx::NativeCursor cursor) OVERRIDE; |
| 67 virtual void CommitVisibility(bool visible) OVERRIDE; | 72 virtual void CommitVisibility(bool visible) OVERRIDE; |
| 68 virtual void CommitScale(float scale) OVERRIDE; | 73 virtual void CommitScale(float scale) OVERRIDE; |
| 69 virtual void CommitCursorSet(ui::CursorSetType cursor_set) OVERRIDE; | 74 virtual void CommitCursorSet(ui::CursorSetType cursor_set) OVERRIDE; |
| 70 virtual void CommitMouseEventsEnabled(bool enabled) OVERRIDE; | 75 virtual void CommitMouseEventsEnabled(bool enabled) OVERRIDE; |
| 71 | 76 |
| 72 scoped_ptr<NativeCursorManager> delegate_; | 77 scoped_ptr<NativeCursorManager> delegate_; |
| 73 | 78 |
| 74 // Number of times LockCursor() has been invoked without a corresponding | 79 // Number of times LockCursor() has been invoked without a corresponding |
| 75 // UnlockCursor(). | 80 // UnlockCursor(). |
| 76 int cursor_lock_count_; | 81 int cursor_lock_count_; |
| 77 | 82 |
| 78 // The current state of the cursor. | 83 // The current state of the cursor. |
| 79 scoped_ptr<internal::CursorState> current_state_; | 84 scoped_ptr<internal::CursorState> current_state_; |
| 80 | 85 |
| 81 // The cursor state to restore when the cursor is unlocked. | 86 // The cursor state to restore when the cursor is unlocked. |
| 82 scoped_ptr<internal::CursorState> state_on_unlock_; | 87 scoped_ptr<internal::CursorState> state_on_unlock_; |
| 83 | 88 |
| 84 ObserverList<aura::client::CursorClientObserver> observers_; | 89 ObserverList<aura::client::CursorClientObserver> observers_; |
| 85 | 90 |
| 86 DISALLOW_COPY_AND_ASSIGN(CursorManager); | 91 DISALLOW_COPY_AND_ASSIGN(CursorManager); |
| 87 }; | 92 }; |
| 88 | 93 |
| 89 } // namespace corewm | 94 } // namespace corewm |
| 90 } // namespace views | 95 } // namespace views |
| 91 | 96 |
| 92 #endif // UI_VIEWS_COREWM_CURSOR_MANAGER_H_ | 97 #endif // UI_VIEWS_COREWM_CURSOR_MANAGER_H_ |
| OLD | NEW |