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_BITMAP_CURSOR_FACTORY_OZONE_H_ | 5 #ifndef UI_BASE_CURSOR_OZONE_BITMAP_CURSOR_FACTORY_OZONE_H_ |
6 #define UI_BASE_CURSOR_OZONE_BITMAP_CURSOR_FACTORY_OZONE_H_ | 6 #define UI_BASE_CURSOR_OZONE_BITMAP_CURSOR_FACTORY_OZONE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 class UI_BASE_EXPORT BitmapCursorFactoryOzone : public CursorFactoryOzone { | 54 class UI_BASE_EXPORT BitmapCursorFactoryOzone : public CursorFactoryOzone { |
55 public: | 55 public: |
56 BitmapCursorFactoryOzone(); | 56 BitmapCursorFactoryOzone(); |
57 ~BitmapCursorFactoryOzone() override; | 57 ~BitmapCursorFactoryOzone() override; |
58 | 58 |
59 // Convert PlatformCursor to BitmapCursorOzone. | 59 // Convert PlatformCursor to BitmapCursorOzone. |
60 static scoped_refptr<BitmapCursorOzone> GetBitmapCursor( | 60 static scoped_refptr<BitmapCursorOzone> GetBitmapCursor( |
61 PlatformCursor platform_cursor); | 61 PlatformCursor platform_cursor); |
62 | 62 |
63 // CursorFactoryOzone: | 63 // CursorFactoryOzone: |
64 PlatformCursor GetDefaultCursor(int type) override; | 64 PlatformCursor GetDefaultCursor(CursorType type) override; |
65 PlatformCursor CreateImageCursor(const SkBitmap& bitmap, | 65 PlatformCursor CreateImageCursor(const SkBitmap& bitmap, |
66 const gfx::Point& hotspot, | 66 const gfx::Point& hotspot, |
67 float bitmap_dpi) override; | 67 float bitmap_dpi) override; |
68 PlatformCursor CreateAnimatedCursor(const std::vector<SkBitmap>& bitmaps, | 68 PlatformCursor CreateAnimatedCursor(const std::vector<SkBitmap>& bitmaps, |
69 const gfx::Point& hotspot, | 69 const gfx::Point& hotspot, |
70 int frame_delay_ms, | 70 int frame_delay_ms, |
71 float bitmap_dpi) override; | 71 float bitmap_dpi) override; |
72 void RefImageCursor(PlatformCursor cursor) override; | 72 void RefImageCursor(PlatformCursor cursor) override; |
73 void UnrefImageCursor(PlatformCursor cursor) override; | 73 void UnrefImageCursor(PlatformCursor cursor) override; |
74 | 74 |
75 private: | 75 private: |
76 // Get cached BitmapCursorOzone for a default cursor. | 76 // Get cached BitmapCursorOzone for a default cursor. |
77 scoped_refptr<BitmapCursorOzone> GetDefaultCursorInternal(int type); | 77 scoped_refptr<BitmapCursorOzone> GetDefaultCursorInternal(CursorType type); |
78 | 78 |
79 // Default cursors are cached & owned by the factory. | 79 // Default cursors are cached & owned by the factory. |
80 typedef std::map<int, scoped_refptr<BitmapCursorOzone> > DefaultCursorMap; | 80 typedef std::map<CursorType, scoped_refptr<BitmapCursorOzone>> |
| 81 DefaultCursorMap; |
81 DefaultCursorMap default_cursors_; | 82 DefaultCursorMap default_cursors_; |
82 | 83 |
83 DISALLOW_COPY_AND_ASSIGN(BitmapCursorFactoryOzone); | 84 DISALLOW_COPY_AND_ASSIGN(BitmapCursorFactoryOzone); |
84 }; | 85 }; |
85 | 86 |
86 } // namespace ui | 87 } // namespace ui |
87 | 88 |
88 #endif // UI_BASE_CURSOR_OZONE_BITMAP_CURSOR_FACTORY_OZONE_H_ | 89 #endif // UI_BASE_CURSOR_OZONE_BITMAP_CURSOR_FACTORY_OZONE_H_ |
OLD | NEW |