OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BASE_CURSOR_OZONE_CURSOR_FACTORY_OZONE_H_ | 5 #ifndef UI_BASE_CURSOR_OZONE_CURSOR_FACTORY_OZONE_H_ |
6 #define UI_BASE_CURSOR_OZONE_CURSOR_FACTORY_OZONE_H_ | 6 #define UI_BASE_CURSOR_OZONE_CURSOR_FACTORY_OZONE_H_ |
7 | 7 |
8 #include "ui/base/cursor/cursor.h" | 8 #include "ui/base/cursor/cursor.h" |
9 #include "ui/base/ui_base_export.h" | 9 #include "ui/base/ui_base_export.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 class UI_BASE_EXPORT CursorFactoryOzone { | 14 class UI_BASE_EXPORT CursorFactoryOzone { |
15 public: | 15 public: |
16 CursorFactoryOzone(); | 16 CursorFactoryOzone(); |
17 virtual ~CursorFactoryOzone(); | 17 virtual ~CursorFactoryOzone(); |
18 | 18 |
19 // Returns the static instance. | 19 // Returns the singleton instance. |
20 static CursorFactoryOzone* GetInstance(); | 20 static CursorFactoryOzone* GetInstance(); |
21 | 21 |
22 // Sets the static instance. Ownership is retained by the caller. | |
23 static void SetInstance(CursorFactoryOzone* impl); | |
24 | |
25 // Return the default cursor of the specified type. The types are listed in | 22 // Return the default cursor of the specified type. The types are listed in |
26 // ui/base/cursor/cursor.h. Default cursors are managed by the implementation | 23 // ui/base/cursor/cursor.h. Default cursors are managed by the implementation |
27 // and must live indefinitely; there's no way to know when to free them. | 24 // and must live indefinitely; there's no way to know when to free them. |
28 virtual PlatformCursor GetDefaultCursor(int type); | 25 virtual PlatformCursor GetDefaultCursor(int type); |
29 | 26 |
30 // Return a image cursor from the specified image & hotspot. Image cursors | 27 // Return a image cursor from the specified image & hotspot. Image cursors |
31 // are referenced counted and have an initial refcount of 1. Therefore, each | 28 // are referenced counted and have an initial refcount of 1. Therefore, each |
32 // CreateImageCursor call must be matched with a call to UnrefImageCursor. | 29 // CreateImageCursor call must be matched with a call to UnrefImageCursor. |
33 virtual PlatformCursor CreateImageCursor(const SkBitmap& bitmap, | 30 virtual PlatformCursor CreateImageCursor(const SkBitmap& bitmap, |
34 const gfx::Point& hotspot); | 31 const gfx::Point& hotspot); |
(...skipping 13 matching lines...) Expand all Loading... |
48 // WindowTreeHost::CanDispatchEvent() is no longer present. | 45 // WindowTreeHost::CanDispatchEvent() is no longer present. |
49 virtual gfx::AcceleratedWidget GetCursorWindow(); | 46 virtual gfx::AcceleratedWidget GetCursorWindow(); |
50 | 47 |
51 private: | 48 private: |
52 static CursorFactoryOzone* impl_; // not owned | 49 static CursorFactoryOzone* impl_; // not owned |
53 }; | 50 }; |
54 | 51 |
55 } // namespace gfx | 52 } // namespace gfx |
56 | 53 |
57 #endif // UI_BASE_CURSOR_OZONE_CURSOR_FACTORY_OZONE_H_ | 54 #endif // UI_BASE_CURSOR_OZONE_CURSOR_FACTORY_OZONE_H_ |
OLD | NEW |