Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ash / wm / ash_native_cursor_manager.h
blob290b701b30bb739a9045e85ad3d2bb558bfb3303
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.
5 #ifndef ASH_WM_ASH_NATIVE_CURSOR_MANAGER_H_
6 #define ASH_WM_ASH_NATIVE_CURSOR_MANAGER_H_
8 #include "ash/ash_export.h"
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/strings/string16.h"
13 #include "ui/gfx/native_widget_types.h"
14 #include "ui/gfx/point.h"
15 #include "ui/wm/core/native_cursor_manager.h"
16 #include "ui/wm/core/native_cursor_manager_delegate.h"
18 namespace ui {
19 class ImageCursors;
22 namespace ash {
24 namespace test {
25 class CursorManagerTestApi;
28 // This does the ash-specific setting of cursor details like cursor
29 // visibility. It communicates back with the CursorManager through the
30 // NativeCursorManagerDelegate interface, which receives messages about what
31 // changes were acted on.
32 class ASH_EXPORT AshNativeCursorManager
33 : public ::wm::NativeCursorManager {
34 public:
35 AshNativeCursorManager();
36 virtual ~AshNativeCursorManager();
38 // Toggle native cursor enabled/disabled.
39 // The native cursor is enabled by default. When disabled, we hide the native
40 // cursor regardless of visibility state, and let CursorWindowManager draw
41 // the cursor.
42 void SetNativeCursorEnabled(bool enabled);
44 private:
45 friend class test::CursorManagerTestApi;
47 // Overridden from ::wm::NativeCursorManager:
48 virtual void SetDisplay(
49 const gfx::Display& display,
50 ::wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
51 virtual void SetCursor(
52 gfx::NativeCursor cursor,
53 ::wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
54 virtual void SetVisibility(
55 bool visible,
56 ::wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
57 virtual void SetCursorSet(
58 ui::CursorSetType cursor_set,
59 ::wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
60 virtual void SetMouseEventsEnabled(
61 bool enabled,
62 ::wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
64 // The cursor location where the cursor was disabled.
65 gfx::Point disabled_cursor_location_;
67 bool native_cursor_enabled_;
69 scoped_ptr<ui::ImageCursors> image_cursors_;
71 DISALLOW_COPY_AND_ASSIGN(AshNativeCursorManager);
74 } // namespace ash
76 #endif // ASH_WM_ASH_NATIVE_CURSOR_MANAGER_H_