OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ |
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class DesktopCursorLoaderUpdater; | 28 class DesktopCursorLoaderUpdater; |
29 | 29 |
30 // A NativeCursorManager that performs the desktop-specific setting of cursor | 30 // A NativeCursorManager that performs the desktop-specific setting of cursor |
31 // state. Similar to AshNativeCursorManager, it also communicates these changes | 31 // state. Similar to AshNativeCursorManager, it also communicates these changes |
32 // to all root windows. | 32 // to all root windows. |
33 class VIEWS_EXPORT DesktopNativeCursorManager | 33 class VIEWS_EXPORT DesktopNativeCursorManager |
34 : public wm::NativeCursorManager { | 34 : public wm::NativeCursorManager { |
35 public: | 35 public: |
36 DesktopNativeCursorManager( | 36 DesktopNativeCursorManager( |
37 scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater); | 37 scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater); |
38 virtual ~DesktopNativeCursorManager(); | 38 ~DesktopNativeCursorManager() override; |
39 | 39 |
40 // Builds a cursor and sets the internal platform representation. | 40 // Builds a cursor and sets the internal platform representation. |
41 gfx::NativeCursor GetInitializedCursor(int type); | 41 gfx::NativeCursor GetInitializedCursor(int type); |
42 | 42 |
43 // Adds |host| to the set |hosts_|. | 43 // Adds |host| to the set |hosts_|. |
44 void AddHost(aura::WindowTreeHost* host); | 44 void AddHost(aura::WindowTreeHost* host); |
45 | 45 |
46 // Removes |host| from the set |hosts_|. | 46 // Removes |host| from the set |hosts_|. |
47 void RemoveHost(aura::WindowTreeHost* host); | 47 void RemoveHost(aura::WindowTreeHost* host); |
48 | 48 |
49 private: | 49 private: |
50 // Overridden from wm::NativeCursorManager: | 50 // Overridden from wm::NativeCursorManager: |
51 virtual void SetDisplay( | 51 void SetDisplay(const gfx::Display& display, |
52 const gfx::Display& display, | 52 wm::NativeCursorManagerDelegate* delegate) override; |
53 wm::NativeCursorManagerDelegate* delegate) override; | 53 void SetCursor(gfx::NativeCursor cursor, |
54 virtual void SetCursor( | 54 wm::NativeCursorManagerDelegate* delegate) override; |
55 gfx::NativeCursor cursor, | 55 void SetVisibility(bool visible, |
56 wm::NativeCursorManagerDelegate* delegate) override; | 56 wm::NativeCursorManagerDelegate* delegate) override; |
57 virtual void SetVisibility( | 57 void SetCursorSet(ui::CursorSetType cursor_set, |
58 bool visible, | 58 wm::NativeCursorManagerDelegate* delegate) override; |
59 wm::NativeCursorManagerDelegate* delegate) override; | 59 void SetMouseEventsEnabled( |
60 virtual void SetCursorSet( | |
61 ui::CursorSetType cursor_set, | |
62 wm::NativeCursorManagerDelegate* delegate) override; | |
63 virtual void SetMouseEventsEnabled( | |
64 bool enabled, | 60 bool enabled, |
65 wm::NativeCursorManagerDelegate* delegate) override; | 61 wm::NativeCursorManagerDelegate* delegate) override; |
66 | 62 |
67 // The set of hosts to notify of changes in cursor state. | 63 // The set of hosts to notify of changes in cursor state. |
68 typedef std::set<aura::WindowTreeHost*> Hosts; | 64 typedef std::set<aura::WindowTreeHost*> Hosts; |
69 Hosts hosts_; | 65 Hosts hosts_; |
70 | 66 |
71 scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater_; | 67 scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater_; |
72 scoped_ptr<ui::CursorLoader> cursor_loader_; | 68 scoped_ptr<ui::CursorLoader> cursor_loader_; |
73 | 69 |
74 DISALLOW_COPY_AND_ASSIGN(DesktopNativeCursorManager); | 70 DISALLOW_COPY_AND_ASSIGN(DesktopNativeCursorManager); |
75 }; | 71 }; |
76 | 72 |
77 } // namespace views | 73 } // namespace views |
78 | 74 |
79 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ | 75 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ |
80 | 76 |
OLD | NEW |