summaryrefslogtreecommitdiffstats
path: root/chromium/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h')
-rw-r--r--chromium/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h48
1 files changed, 28 insertions, 20 deletions
diff --git a/chromium/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h b/chromium/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
index 563131d92cc..ee156348774 100644
--- a/chromium/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
+++ b/chromium/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
@@ -5,61 +5,69 @@
#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"
#include "ui/views/views_export.h"
+#include "ui/wm/core/native_cursor_manager.h"
namespace aura {
-class RootWindow;
+class WindowTreeHost;
}
namespace ui {
class CursorLoader;
}
-namespace views {
-class DesktopCursorLoaderUpdater;
-
-namespace corewm {
+namespace wm {
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.)
+namespace views {
+class DesktopCursorLoaderUpdater;
+
+// 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 wm::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 |host| to the set |hosts_|.
+ void AddHost(aura::WindowTreeHost* host);
+
+ // Removes |host| from the set |hosts_|.
+ void RemoveHost(aura::WindowTreeHost* host);
+
private:
- // Overridden from views::corewm::NativeCursorManager:
+ // Overridden from wm::NativeCursorManager:
virtual void SetDisplay(
const gfx::Display& display,
- views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+ wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
virtual void SetCursor(
gfx::NativeCursor cursor,
- views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+ wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
virtual void SetVisibility(
bool visible,
- views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+ wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
virtual void SetCursorSet(
ui::CursorSetType cursor_set,
- views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
- virtual void SetScale(
- float scale,
- views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+ wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
virtual void SetMouseEventsEnabled(
bool enabled,
- views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+ wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+
+ // The set of hosts to notify of changes in cursor state.
+ typedef std::set<aura::WindowTreeHost*> Hosts;
+ Hosts hosts_;
- aura::RootWindow* root_window_;
scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater_;
scoped_ptr<ui::CursorLoader> cursor_loader_;