Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1156)

Unified Diff: ui/base/cursor/image_cursors.cc

Issue 2961403002: WIP fix for Ozone cursor woes in Mushrome: Numéro deux
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/cursor/image_cursors.h ('k') | ui/ozone/public/cursor_factory_ozone.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/base/cursor/image_cursors.h ('k') | ui/ozone/public/cursor_factory_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698