| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_CURSOR_CLIENT_H_ | |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_CURSOR_CLIENT_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "ui/aura/client/cursor_client.h" | |
| 11 #include "ui/views/views_export.h" | |
| 12 | |
| 13 namespace aura { | |
| 14 class RootWindow; | |
| 15 } | |
| 16 | |
| 17 namespace ui { | |
| 18 class CursorLoader; | |
| 19 } | |
| 20 | |
| 21 namespace views { | |
| 22 | |
| 23 // A CursorClient that interacts with only one RootWindow. (Unlike the one in | |
| 24 // ash, which interacts with all the RootWindows.) | |
| 25 class VIEWS_EXPORT DesktopCursorClient : public aura::client::CursorClient { | |
| 26 public: | |
| 27 explicit DesktopCursorClient(aura::RootWindow* window); | |
| 28 virtual ~DesktopCursorClient(); | |
| 29 | |
| 30 // 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; | |
| 39 virtual void LockCursor() OVERRIDE; | |
| 40 virtual void UnlockCursor() OVERRIDE; | |
| 41 | |
| 42 private: | |
| 43 void SetCursorVisibility(bool visible); | |
| 44 | |
| 45 aura::RootWindow* root_window_; | |
| 46 scoped_ptr<ui::CursorLoader> cursor_loader_; | |
| 47 | |
| 48 gfx::NativeCursor current_cursor_; | |
| 49 bool cursor_visible_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(DesktopCursorClient); | |
| 52 }; | |
| 53 | |
| 54 } // namespace views | |
| 55 | |
| 56 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_CURSOR_CLIENT_H_ | |
| OLD | NEW |