| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(int type) override; |
| 65 PlatformCursor CreateImageCursor(const SkBitmap& bitmap, | 65 PlatformCursor CreateImageCursor(const SkBitmap& bitmap, |
| 66 const gfx::Point& hotspot) override; | 66 const gfx::Point& hotspot, |
| 67 PlatformCursor CreateAnimatedCursor( | 67 float bitmap_dpi) override; |
| 68 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) override; | 70 int frame_delay_ms, |
| 71 float bitmap_dpi) override; |
| 71 void RefImageCursor(PlatformCursor cursor) override; | 72 void RefImageCursor(PlatformCursor cursor) override; |
| 72 void UnrefImageCursor(PlatformCursor cursor) override; | 73 void UnrefImageCursor(PlatformCursor cursor) override; |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 // Get cached BitmapCursorOzone for a default cursor. | 76 // Get cached BitmapCursorOzone for a default cursor. |
| 76 scoped_refptr<BitmapCursorOzone> GetDefaultCursorInternal(int type); | 77 scoped_refptr<BitmapCursorOzone> GetDefaultCursorInternal(int type); |
| 77 | 78 |
| 78 // Default cursors are cached & owned by the factory. | 79 // Default cursors are cached & owned by the factory. |
| 79 typedef std::map<int, scoped_refptr<BitmapCursorOzone> > DefaultCursorMap; | 80 typedef std::map<int, scoped_refptr<BitmapCursorOzone> > DefaultCursorMap; |
| 80 DefaultCursorMap default_cursors_; | 81 DefaultCursorMap default_cursors_; |
| 81 | 82 |
| 82 DISALLOW_COPY_AND_ASSIGN(BitmapCursorFactoryOzone); | 83 DISALLOW_COPY_AND_ASSIGN(BitmapCursorFactoryOzone); |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 } // namespace ui | 86 } // namespace ui |
| 86 | 87 |
| 87 #endif // UI_BASE_CURSOR_OZONE_BITMAP_CURSOR_FACTORY_OZONE_H_ | 88 #endif // UI_BASE_CURSOR_OZONE_BITMAP_CURSOR_FACTORY_OZONE_H_ |
| OLD | NEW |