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

Unified Diff: ui/views/widget/desktop_aura/desktop_native_cursor_manager.h

Issue 111043002: Cursor state should be global for desktop Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test added 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
Index: ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
diff --git a/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h b/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
index 563131d92cc006e23e5332a3bc6c42b8e241155f..18732b0645ff8439d10d78c9bb86beaeaf981d65 100644
--- a/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
+++ b/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
@@ -5,6 +5,8 @@
#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_
#define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_
+#include <set>
+
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "ui/views/corewm/native_cursor_manager.h"
@@ -25,19 +27,25 @@ namespace corewm {
class NativeCursorManagerDelegate;
}
-// A NativeCursorManager that interacts with only one RootWindow. (Unlike the
-// one in ash, which interacts with all the RootWindows that ash knows about.)
+// A NativeCursorManager that performs the desktop-specific setting of cursor
+// state. Similar to AshNativeCursorManager, it also communicates these changes
+// to all root windows.
class VIEWS_EXPORT DesktopNativeCursorManager
: public views::corewm::NativeCursorManager {
public:
DesktopNativeCursorManager(
- aura::RootWindow* window,
scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater);
virtual ~DesktopNativeCursorManager();
// Builds a cursor and sets the internal platform representation.
gfx::NativeCursor GetInitializedCursor(int type);
+ // Adds |root_window| to the set |root_windows_|.
+ void AddRootWindow(aura::RootWindow* root_window);
+
+ // Removes |root_window| from the set |root_windows_|.
+ void RemoveRootWindow(aura::RootWindow* root_window);
+
private:
// Overridden from views::corewm::NativeCursorManager:
virtual void SetDisplay(
@@ -59,7 +67,10 @@ class VIEWS_EXPORT DesktopNativeCursorManager
bool enabled,
views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
- aura::RootWindow* root_window_;
+ // The set of root windows to notify of changes in cursor state.
+ typedef std::set<aura::RootWindow*> RootWindows;
+ RootWindows root_windows_;
+
scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater_;
scoped_ptr<ui::CursorLoader> cursor_loader_;

Powered by Google App Engine
This is Rietveld 408576698