| 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);
|
| };
|
|
|
|
|