Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: ui/views/corewm/cursor_manager.h

Issue 92413002: Cursor state should be global for all CursorManagers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/test/test_cursor_client.cc ('k') | ui/views/corewm/cursor_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/cursor_manager.h
diff --git a/ui/views/corewm/cursor_manager.h b/ui/views/corewm/cursor_manager.h
index 1706ed8f7af5836f9c55e8b75393d3fd4d076abf..cb5792a2ad4d0f136a794813a640ee8c2aee24d9 100644
--- a/ui/views/corewm/cursor_manager.h
+++ b/ui/views/corewm/cursor_manager.h
@@ -36,18 +36,32 @@ class NativeCursorManager;
class VIEWS_EXPORT CursorManager : public aura::client::CursorClient,
public NativeCursorManagerDelegate {
public:
+ class VIEWS_EXPORT TestApi {
+ public:
+ explicit TestApi(CursorManager* cursor_manager)
+ : cursor_manager_(cursor_manager) {
+ }
+ ~TestApi() {}
+
+ void ResetState();
+
+ private:
+ CursorManager* cursor_manager_;
+ };
+
CursorManager(scoped_ptr<NativeCursorManager> delegate);
virtual ~CursorManager();
// Overridden from aura::client::CursorClient:
virtual void SetCursor(gfx::NativeCursor) OVERRIDE;
+ virtual gfx::NativeCursor GetCursor() const OVERRIDE;
virtual void ShowCursor() OVERRIDE;
virtual void HideCursor() OVERRIDE;
virtual bool IsCursorVisible() const OVERRIDE;
virtual void SetScale(float scale) OVERRIDE;
- virtual float GetCurrentScale() const OVERRIDE;
+ virtual float GetScale() const OVERRIDE;
virtual void SetCursorSet(ui::CursorSetType cursor_set) OVERRIDE;
- virtual ui::CursorSetType GetCurrentCursorSet() const OVERRIDE;
+ virtual ui::CursorSetType GetCursorSet() const OVERRIDE;
virtual void EnableMouseEvents() OVERRIDE;
virtual void DisableMouseEvents() OVERRIDE;
virtual bool IsMouseEventsEnabled() const OVERRIDE;
@@ -62,9 +76,6 @@ class VIEWS_EXPORT CursorManager : public aura::client::CursorClient,
private:
// Overridden from NativeCursorManagerDelegate:
- virtual gfx::NativeCursor GetCurrentCursor() const OVERRIDE;
- virtual bool GetCurrentVisibility() const OVERRIDE;
- virtual bool GetMouseEventsEnabled() const OVERRIDE;
virtual void CommitCursor(gfx::NativeCursor cursor) OVERRIDE;
virtual void CommitVisibility(bool visible) OVERRIDE;
virtual void CommitScale(float scale) OVERRIDE;
@@ -75,15 +86,16 @@ class VIEWS_EXPORT CursorManager : public aura::client::CursorClient,
// Number of times LockCursor() has been invoked without a corresponding
// UnlockCursor().
- int cursor_lock_count_;
+ static int cursor_lock_count_;
// The current state of the cursor.
- scoped_ptr<internal::CursorState> current_state_;
+ static internal::CursorState* current_state_;
// The cursor state to restore when the cursor is unlocked.
- scoped_ptr<internal::CursorState> state_on_unlock_;
+ static internal::CursorState* state_on_unlock_;
- ObserverList<aura::client::CursorClientObserver> observers_;
+ typedef ObserverList<aura::client::CursorClientObserver> CursorObservers;
+ static CursorObservers* observers_;
DISALLOW_COPY_AND_ASSIGN(CursorManager);
};
« no previous file with comments | « ui/aura/test/test_cursor_client.cc ('k') | ui/views/corewm/cursor_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698