1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "ui/views/views_export.h"
13 #include "ui/wm/core/native_cursor_manager.h"
24 class NativeCursorManagerDelegate
;
28 class DesktopCursorLoaderUpdater
;
30 // A NativeCursorManager that performs the desktop-specific setting of cursor
31 // state. Similar to AshNativeCursorManager, it also communicates these changes
32 // to all root windows.
33 class VIEWS_EXPORT DesktopNativeCursorManager
34 : public wm::NativeCursorManager
{
36 DesktopNativeCursorManager(
37 scoped_ptr
<DesktopCursorLoaderUpdater
> cursor_loader_updater
);
38 virtual ~DesktopNativeCursorManager();
40 // Builds a cursor and sets the internal platform representation.
41 gfx::NativeCursor
GetInitializedCursor(int type
);
43 // Adds |host| to the set |hosts_|.
44 void AddHost(aura::WindowTreeHost
* host
);
46 // Removes |host| from the set |hosts_|.
47 void RemoveHost(aura::WindowTreeHost
* host
);
50 // Overridden from wm::NativeCursorManager:
51 virtual void SetDisplay(
52 const gfx::Display
& display
,
53 wm::NativeCursorManagerDelegate
* delegate
) OVERRIDE
;
54 virtual void SetCursor(
55 gfx::NativeCursor cursor
,
56 wm::NativeCursorManagerDelegate
* delegate
) OVERRIDE
;
57 virtual void SetVisibility(
59 wm::NativeCursorManagerDelegate
* delegate
) OVERRIDE
;
60 virtual void SetCursorSet(
61 ui::CursorSetType cursor_set
,
62 wm::NativeCursorManagerDelegate
* delegate
) OVERRIDE
;
63 virtual void SetMouseEventsEnabled(
65 wm::NativeCursorManagerDelegate
* delegate
) OVERRIDE
;
67 // The set of hosts to notify of changes in cursor state.
68 typedef std::set
<aura::WindowTreeHost
*> Hosts
;
71 scoped_ptr
<DesktopCursorLoaderUpdater
> cursor_loader_updater_
;
72 scoped_ptr
<ui::CursorLoader
> cursor_loader_
;
74 DISALLOW_COPY_AND_ASSIGN(DesktopNativeCursorManager
);
79 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_