| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "ui/views/views_export.h" | 12 #include "ui/views/views_export.h" |
| 13 #include "ui/wm/core/native_cursor_manager.h" | 13 #include "ui/wm/core/native_cursor_manager.h" |
| 14 | 14 |
| 15 namespace aura { | 15 namespace aura { |
| 16 class WindowTreeHost; | 16 class WindowTreeHost; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace ui { | 19 namespace ui { |
| 20 class CursorLoader; | 20 class CursorLoader; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace wm { |
| 24 class NativeCursorManagerDelegate; |
| 25 } |
| 26 |
| 23 namespace views { | 27 namespace views { |
| 24 class DesktopCursorLoaderUpdater; | 28 class DesktopCursorLoaderUpdater; |
| 25 | 29 |
| 26 namespace corewm { | |
| 27 class NativeCursorManagerDelegate; | |
| 28 } | |
| 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 views::corewm::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 virtual ~DesktopNativeCursorManager(); |
| 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 views::corewm::NativeCursorManager: | 50 // Overridden from wm::NativeCursorManager: |
| 51 virtual void SetDisplay( | 51 virtual void SetDisplay( |
| 52 const gfx::Display& display, | 52 const gfx::Display& display, |
| 53 views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; | 53 wm::NativeCursorManagerDelegate* delegate) OVERRIDE; |
| 54 virtual void SetCursor( | 54 virtual void SetCursor( |
| 55 gfx::NativeCursor cursor, | 55 gfx::NativeCursor cursor, |
| 56 views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; | 56 wm::NativeCursorManagerDelegate* delegate) OVERRIDE; |
| 57 virtual void SetVisibility( | 57 virtual void SetVisibility( |
| 58 bool visible, | 58 bool visible, |
| 59 views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; | 59 wm::NativeCursorManagerDelegate* delegate) OVERRIDE; |
| 60 virtual void SetCursorSet( | 60 virtual void SetCursorSet( |
| 61 ui::CursorSetType cursor_set, | 61 ui::CursorSetType cursor_set, |
| 62 views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; | 62 wm::NativeCursorManagerDelegate* delegate) OVERRIDE; |
| 63 virtual void SetScale( | 63 virtual void SetScale( |
| 64 float scale, | 64 float scale, |
| 65 views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; | 65 wm::NativeCursorManagerDelegate* delegate) OVERRIDE; |
| 66 virtual void SetMouseEventsEnabled( | 66 virtual void SetMouseEventsEnabled( |
| 67 bool enabled, | 67 bool enabled, |
| 68 views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; | 68 wm::NativeCursorManagerDelegate* delegate) OVERRIDE; |
| 69 | 69 |
| 70 // The set of hosts to notify of changes in cursor state. | 70 // The set of hosts to notify of changes in cursor state. |
| 71 typedef std::set<aura::WindowTreeHost*> Hosts; | 71 typedef std::set<aura::WindowTreeHost*> Hosts; |
| 72 Hosts hosts_; | 72 Hosts hosts_; |
| 73 | 73 |
| 74 scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater_; | 74 scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater_; |
| 75 scoped_ptr<ui::CursorLoader> cursor_loader_; | 75 scoped_ptr<ui::CursorLoader> cursor_loader_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(DesktopNativeCursorManager); | 77 DISALLOW_COPY_AND_ASSIGN(DesktopNativeCursorManager); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace views | 80 } // namespace views |
| 81 | 81 |
| 82 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ | 82 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ |
| 83 | 83 |
| OLD | NEW |