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

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

Issue 100173003: Cursor state should be global among all root windows for desktop Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make DesktopNativeCursorManager a WindowObserver 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 | « no previous file | ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..81103133b27035d192c8cb5407608ea2fd51060a 100644
--- a/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
+++ b/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
@@ -5,8 +5,11 @@
#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/aura/window_observer.h"
#include "ui/views/corewm/native_cursor_manager.h"
#include "ui/views/views_export.h"
@@ -25,10 +28,12 @@ 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 views::corewm::NativeCursorManager,
+ public aura::WindowObserver {
public:
DesktopNativeCursorManager(
aura::RootWindow* window,
@@ -38,7 +43,13 @@ class VIEWS_EXPORT DesktopNativeCursorManager
// Builds a cursor and sets the internal platform representation.
gfx::NativeCursor GetInitializedCursor(int type);
+ // Overridden from aura::WindowObserver:
+ virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+
private:
+ // Invoked from destructor and OnWindowDestroyed() to cleanup.
+ void Shutdown();
+
// Overridden from views::corewm::NativeCursorManager:
virtual void SetDisplay(
const gfx::Display& display,
@@ -59,10 +70,16 @@ class VIEWS_EXPORT DesktopNativeCursorManager
bool enabled,
views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+ // The root window for which this DesktopNativeCursorManager was created.
aura::RootWindow* root_window_;
+
scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater_;
scoped_ptr<ui::CursorLoader> cursor_loader_;
+ // The set of all root windows to notify of changes in cursor state.
+ typedef std::set<aura::RootWindow*> RootWindows;
+ static RootWindows* root_windows_;
+
DISALLOW_COPY_AND_ASSIGN(DesktopNativeCursorManager);
};
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698