OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_CURSORD_DATA_FACTORY_OZONE_H_ | 5 #ifndef UI_BASE_CURSOR_OZONE_CURSORD_DATA_FACTORY_OZONE_H_ |
6 #define UI_BASE_CURSOR_OZONE_CURSORD_DATA_FACTORY_OZONE_H_ | 6 #define UI_BASE_CURSOR_OZONE_CURSORD_DATA_FACTORY_OZONE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // creating code, and builds the cross platform mojo data structure. | 57 // creating code, and builds the cross platform mojo data structure. |
58 class UI_BASE_EXPORT CursorDataFactoryOzone : public CursorFactoryOzone { | 58 class UI_BASE_EXPORT CursorDataFactoryOzone : public CursorFactoryOzone { |
59 public: | 59 public: |
60 CursorDataFactoryOzone(); | 60 CursorDataFactoryOzone(); |
61 ~CursorDataFactoryOzone() override; | 61 ~CursorDataFactoryOzone() override; |
62 | 62 |
63 // Converts a PlatformCursor back to a ui::CursorData. | 63 // Converts a PlatformCursor back to a ui::CursorData. |
64 static const ui::CursorData& GetCursorData(PlatformCursor platform_cursor); | 64 static const ui::CursorData& GetCursorData(PlatformCursor platform_cursor); |
65 | 65 |
66 // CursorFactoryOzone: | 66 // CursorFactoryOzone: |
67 PlatformCursor GetDefaultCursor(int type) override; | 67 PlatformCursor GetDefaultCursor(CursorType type) override; |
68 PlatformCursor CreateImageCursor(const SkBitmap& bitmap, | 68 PlatformCursor CreateImageCursor(const SkBitmap& bitmap, |
69 const gfx::Point& hotspot, | 69 const gfx::Point& hotspot, |
70 float bitmap_dpi) override; | 70 float bitmap_dpi) override; |
71 PlatformCursor CreateAnimatedCursor(const std::vector<SkBitmap>& bitmaps, | 71 PlatformCursor CreateAnimatedCursor(const std::vector<SkBitmap>& bitmaps, |
72 const gfx::Point& hotspot, | 72 const gfx::Point& hotspot, |
73 int frame_delay_ms, | 73 int frame_delay_ms, |
74 float bitmap_dpi) override; | 74 float bitmap_dpi) override; |
75 void RefImageCursor(PlatformCursor cursor) override; | 75 void RefImageCursor(PlatformCursor cursor) override; |
76 void UnrefImageCursor(PlatformCursor cursor) override; | 76 void UnrefImageCursor(PlatformCursor cursor) override; |
77 | 77 |
78 private: | 78 private: |
79 // Get cached BitmapCursorOzone for a default cursor. | 79 // Get cached BitmapCursorOzone for a default cursor. |
80 scoped_refptr<CursorDataOzone> GetDefaultCursorInternal(int type); | 80 scoped_refptr<CursorDataOzone> GetDefaultCursorInternal(CursorType type); |
81 | 81 |
82 // Default cursors are cached & owned by the factory. | 82 // Default cursors are cached & owned by the factory. |
83 typedef std::map<int, scoped_refptr<CursorDataOzone>> DefaultCursorMap; | 83 typedef std::map<CursorType, scoped_refptr<CursorDataOzone>> DefaultCursorMap; |
84 DefaultCursorMap default_cursors_; | 84 DefaultCursorMap default_cursors_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(CursorDataFactoryOzone); | 86 DISALLOW_COPY_AND_ASSIGN(CursorDataFactoryOzone); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace ui | 89 } // namespace ui |
90 | 90 |
91 #endif // UI_BASE_CURSOR_OZONE_CURSORD_DATA_FACTORY_OZONE_H_ | 91 #endif // UI_BASE_CURSOR_OZONE_CURSORD_DATA_FACTORY_OZONE_H_ |
OLD | NEW |