| 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 PlatformCursor platform_cursor); | 53 PlatformCursor platform_cursor); |
| 54 | 54 |
| 55 // CursorFactoryOzone: | 55 // CursorFactoryOzone: |
| 56 virtual PlatformCursor GetDefaultCursor(int type) OVERRIDE; | 56 virtual PlatformCursor GetDefaultCursor(int type) OVERRIDE; |
| 57 virtual PlatformCursor CreateImageCursor(const SkBitmap& bitmap, | 57 virtual PlatformCursor CreateImageCursor(const SkBitmap& bitmap, |
| 58 const gfx::Point& hotspot) OVERRIDE; | 58 const gfx::Point& hotspot) OVERRIDE; |
| 59 virtual void RefImageCursor(PlatformCursor cursor) OVERRIDE; | 59 virtual void RefImageCursor(PlatformCursor cursor) OVERRIDE; |
| 60 virtual void UnrefImageCursor(PlatformCursor cursor) OVERRIDE; | 60 virtual void UnrefImageCursor(PlatformCursor cursor) OVERRIDE; |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 // Get cached BitmapCursorOzone for a default cursor. |
| 64 scoped_refptr<BitmapCursorOzone> GetDefaultCursorInternal(int type); |
| 65 |
| 63 // Default cursors are cached & owned by the factory. | 66 // Default cursors are cached & owned by the factory. |
| 64 typedef std::map<int, scoped_refptr<BitmapCursorOzone> > DefaultCursorMap; | 67 typedef std::map<int, scoped_refptr<BitmapCursorOzone> > DefaultCursorMap; |
| 65 DefaultCursorMap default_cursors_; | 68 DefaultCursorMap default_cursors_; |
| 66 | 69 |
| 67 DISALLOW_COPY_AND_ASSIGN(BitmapCursorFactoryOzone); | 70 DISALLOW_COPY_AND_ASSIGN(BitmapCursorFactoryOzone); |
| 68 }; | 71 }; |
| 69 | 72 |
| 70 } // namespace ui | 73 } // namespace ui |
| 71 | 74 |
| 72 #endif // UI_BASE_CURSOR_OZONE_BITMAP_CURSOR_FACTORY_OZONE_H_ | 75 #endif // UI_BASE_CURSOR_OZONE_BITMAP_CURSOR_FACTORY_OZONE_H_ |
| OLD | NEW |