Index: ui/base/cursor/image_cursors.cc |
diff --git a/ui/base/cursor/image_cursors.cc b/ui/base/cursor/image_cursors.cc |
index 28d1e93b7ddc190d31f5c0f041928d66626afd5a..2d85ca36846e457d9aaa634edb9f65bf2593d120 100644 |
--- a/ui/base/cursor/image_cursors.cc |
+++ b/ui/base/cursor/image_cursors.cc |
@@ -66,6 +66,11 @@ ImageCursors::ImageCursors() |
ImageCursors::~ImageCursors() { |
} |
+void ImageCursors::Initialize() { |
+ if (!cursor_loader_) |
+ cursor_loader_.reset(CursorLoader::Create()); |
+} |
+ |
float ImageCursors::GetScale() const { |
if (!cursor_loader_) { |
NOTREACHED(); |
@@ -147,4 +152,23 @@ base::WeakPtr<ImageCursors> ImageCursors::GetWeakPtr() { |
return weak_ptr_factory_.GetWeakPtr(); |
} |
+ImageCursorsHolder::ImageCursorsHolder() : weak_ptr_factory_(this) {} |
+ |
+ImageCursorsHolder::~ImageCursorsHolder() {} |
+ |
+ImageCursors* ImageCursorsHolder::GetImageCursors() { |
+ DCHECK(image_cursors_); |
+ return image_cursors_.get(); |
+} |
+ |
+void ImageCursorsHolder::SetImageCursors( |
+ std::unique_ptr<ImageCursors> image_cursors) { |
+ DCHECK(!image_cursors_); |
+ image_cursors_ = std::move(image_cursors); |
+} |
+ |
+base::WeakPtr<ImageCursorsHolder> ImageCursorsHolder::GetWeakPtr() { |
+ return weak_ptr_factory_.GetWeakPtr(); |
+} |
+ |
} // namespace ui |