| 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 <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "ui/views/views_export.h" | 13 #include "ui/views/views_export.h" |
| 14 #include "ui/wm/core/native_cursor_manager.h" | 14 #include "ui/wm/core/native_cursor_manager.h" |
| 15 | 15 |
| 16 namespace aura { | 16 namespace aura { |
| 17 class WindowTreeHost; | 17 class WindowTreeHost; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace ui { | 20 namespace ui { |
| 21 class CursorLoader; | 21 class CursorLoader; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace wm { | 24 namespace wm { |
| 25 class NativeCursorManagerDelegate; | 25 class NativeCursorManagerDelegate; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace views { | 28 namespace views { |
| 29 class DesktopCursorLoaderUpdater; | |
| 30 | 29 |
| 31 // A NativeCursorManager that performs the desktop-specific setting of cursor | 30 // A NativeCursorManager that performs the desktop-specific setting of cursor |
| 32 // state. Similar to AshNativeCursorManager, it also communicates these changes | 31 // state. Similar to AshNativeCursorManager, it also communicates these changes |
| 33 // to all root windows. | 32 // to all root windows. |
| 34 class VIEWS_EXPORT DesktopNativeCursorManager | 33 class VIEWS_EXPORT DesktopNativeCursorManager |
| 35 : public wm::NativeCursorManager { | 34 : public wm::NativeCursorManager { |
| 36 public: | 35 public: |
| 37 DesktopNativeCursorManager( | 36 DesktopNativeCursorManager(); |
| 38 std::unique_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater); | |
| 39 ~DesktopNativeCursorManager() override; | 37 ~DesktopNativeCursorManager() override; |
| 40 | 38 |
| 41 // Builds a cursor and sets the internal platform representation. The return | 39 // Builds a cursor and sets the internal platform representation. The return |
| 42 // value should not be cached. | 40 // value should not be cached. |
| 43 gfx::NativeCursor GetInitializedCursor(int type); | 41 gfx::NativeCursor GetInitializedCursor(int type); |
| 44 | 42 |
| 45 // Adds |host| to the set |hosts_|. | 43 // Adds |host| to the set |hosts_|. |
| 46 void AddHost(aura::WindowTreeHost* host); | 44 void AddHost(aura::WindowTreeHost* host); |
| 47 | 45 |
| 48 // Removes |host| from the set |hosts_|. | 46 // Removes |host| from the set |hosts_|. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 59 void SetCursorSet(ui::CursorSetType cursor_set, | 57 void SetCursorSet(ui::CursorSetType cursor_set, |
| 60 wm::NativeCursorManagerDelegate* delegate) override; | 58 wm::NativeCursorManagerDelegate* delegate) override; |
| 61 void SetMouseEventsEnabled( | 59 void SetMouseEventsEnabled( |
| 62 bool enabled, | 60 bool enabled, |
| 63 wm::NativeCursorManagerDelegate* delegate) override; | 61 wm::NativeCursorManagerDelegate* delegate) override; |
| 64 | 62 |
| 65 // The set of hosts to notify of changes in cursor state. | 63 // The set of hosts to notify of changes in cursor state. |
| 66 typedef std::set<aura::WindowTreeHost*> Hosts; | 64 typedef std::set<aura::WindowTreeHost*> Hosts; |
| 67 Hosts hosts_; | 65 Hosts hosts_; |
| 68 | 66 |
| 69 std::unique_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater_; | |
| 70 std::unique_ptr<ui::CursorLoader> cursor_loader_; | 67 std::unique_ptr<ui::CursorLoader> cursor_loader_; |
| 71 | 68 |
| 72 DISALLOW_COPY_AND_ASSIGN(DesktopNativeCursorManager); | 69 DISALLOW_COPY_AND_ASSIGN(DesktopNativeCursorManager); |
| 73 }; | 70 }; |
| 74 | 71 |
| 75 } // namespace views | 72 } // namespace views |
| 76 | 73 |
| 77 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ | 74 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ |
| 78 | |
| OLD | NEW |