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