| 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_CURSOR_CLIENT_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_CURSOR_CLIENT_H_ |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_CURSOR_CLIENT_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_CURSOR_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
| 11 #include "ui/views/corewm/cursor_controller.h" |
| 11 #include "ui/views/views_export.h" | 12 #include "ui/views/views_export.h" |
| 12 | 13 |
| 13 namespace aura { | 14 namespace aura { |
| 14 class RootWindow; | 15 class RootWindow; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace ui { | 18 namespace ui { |
| 18 class CursorLoader; | 19 class CursorLoader; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace views { | 22 namespace views { |
| 22 | 23 |
| 23 // A CursorClient that interacts with only one RootWindow. (Unlike the one in | 24 // A CursorClient that interacts with only one RootWindow. (Unlike the one in |
| 24 // ash, which interacts with all the RootWindows.) | 25 // ash, which interacts with all the RootWindows.) |
| 25 class VIEWS_EXPORT DesktopCursorClient : public aura::client::CursorClient { | 26 class VIEWS_EXPORT DesktopCursorClient |
| 27 : public views::corewm::CursorController { |
| 26 public: | 28 public: |
| 27 explicit DesktopCursorClient(aura::RootWindow* window); | 29 explicit DesktopCursorClient(aura::RootWindow* window); |
| 28 virtual ~DesktopCursorClient(); | 30 virtual ~DesktopCursorClient(); |
| 29 | 31 |
| 30 // Overridden from client::CursorClient: | 32 // Overridden from client::CursorClient: |
| 31 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | |
| 32 virtual void ShowCursor() OVERRIDE; | |
| 33 virtual void HideCursor() OVERRIDE; | |
| 34 virtual bool IsCursorVisible() const OVERRIDE; | |
| 35 virtual void EnableMouseEvents() OVERRIDE; | |
| 36 virtual void DisableMouseEvents() OVERRIDE; | |
| 37 virtual bool IsMouseEventsEnabled() const OVERRIDE; | |
| 38 virtual void SetDeviceScaleFactor(float device_scale_factor) OVERRIDE; | 33 virtual void SetDeviceScaleFactor(float device_scale_factor) OVERRIDE; |
| 39 virtual void LockCursor() OVERRIDE; | |
| 40 virtual void UnlockCursor() OVERRIDE; | |
| 41 | 34 |
| 42 private: | 35 private: |
| 43 void SetCursorVisibility(bool visible); | 36 // Overridden from views::corewm::CursorController: |
| 37 virtual void SetCursorInternal(gfx::NativeCursor cursor) OVERRIDE; |
| 38 virtual void SetCursorVisibility(bool visible) OVERRIDE; |
| 39 virtual void SetMouseEventsEnabled(bool enabled) OVERRIDE; |
| 44 | 40 |
| 45 aura::RootWindow* root_window_; | 41 aura::RootWindow* root_window_; |
| 46 scoped_ptr<ui::CursorLoader> cursor_loader_; | 42 scoped_ptr<ui::CursorLoader> cursor_loader_; |
| 47 | 43 |
| 48 gfx::NativeCursor current_cursor_; | |
| 49 bool cursor_visible_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(DesktopCursorClient); | 44 DISALLOW_COPY_AND_ASSIGN(DesktopCursorClient); |
| 52 }; | 45 }; |
| 53 | 46 |
| 54 } // namespace views | 47 } // namespace views |
| 55 | 48 |
| 56 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_CURSOR_CLIENT_H_ | 49 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_CURSOR_CLIENT_H_ |
| OLD | NEW |