| Index: ui/base/cursor/cursor_loader_ozone.cc
|
| diff --git a/ui/base/cursor/cursor_loader_ozone.cc b/ui/base/cursor/cursor_loader_ozone.cc
|
| index 5f1ba8ec57c55a8ead4881f196e8e35747482009..c7af31e3b51f6416aa3cda29a60d6c404b5552f0 100644
|
| --- a/ui/base/cursor/cursor_loader_ozone.cc
|
| +++ b/ui/base/cursor/cursor_loader_ozone.cc
|
| @@ -6,13 +6,16 @@
|
|
|
| #include <vector>
|
|
|
| +#include "base/debug/stack_trace.h"
|
| #include "ui/base/cursor/cursor.h"
|
| #include "ui/base/cursor/cursor_util.h"
|
| #include "ui/ozone/public/cursor_factory_ozone.h"
|
|
|
| namespace ui {
|
|
|
| -CursorLoaderOzone::CursorLoaderOzone() {}
|
| +CursorLoaderOzone::CursorLoaderOzone() {
|
| + factory_ = CursorFactoryOzone::GetInstance();
|
| +}
|
|
|
| CursorLoaderOzone::~CursorLoaderOzone() {}
|
|
|
| @@ -24,8 +27,7 @@ void CursorLoaderOzone::LoadImageCursor(CursorType id,
|
|
|
| GetImageCursorBitmap(resource_id, scale(), rotation(), &hotspot, &bitmap);
|
|
|
| - cursors_[id] = CursorFactoryOzone::GetInstance()->CreateImageCursor(
|
| - bitmap, hotspot, scale());
|
| + cursors_[id] = factory_->CreateImageCursor(bitmap, hotspot, scale());
|
| }
|
|
|
| void CursorLoaderOzone::LoadAnimatedCursor(CursorType id,
|
| @@ -38,15 +40,15 @@ void CursorLoaderOzone::LoadAnimatedCursor(CursorType id,
|
| GetAnimatedCursorBitmaps(
|
| resource_id, scale(), rotation(), &hotspot, &bitmaps);
|
|
|
| - cursors_[id] = CursorFactoryOzone::GetInstance()->CreateAnimatedCursor(
|
| - bitmaps, hotspot, frame_delay_ms, scale());
|
| + cursors_[id] =
|
| + factory_->CreateAnimatedCursor(bitmaps, hotspot, frame_delay_ms, scale());
|
| }
|
|
|
| void CursorLoaderOzone::UnloadAll() {
|
| for (ImageCursorMap::const_iterator it = cursors_.begin();
|
| - it != cursors_.end();
|
| - ++it)
|
| - CursorFactoryOzone::GetInstance()->UnrefImageCursor(it->second);
|
| + it != cursors_.end(); ++it) {
|
| + factory_->UnrefImageCursor(it->second);
|
| + }
|
| cursors_.clear();
|
| }
|
|
|
| @@ -62,7 +64,7 @@ void CursorLoaderOzone::SetPlatformCursor(gfx::NativeCursor* cursor) {
|
| platform = cursor->platform();
|
| } else {
|
| // Use default cursor of this type.
|
| - platform = CursorFactoryOzone::GetInstance()->GetDefaultCursor(native_type);
|
| + platform = factory_->GetDefaultCursor(native_type);
|
| }
|
|
|
| cursor->SetPlatformCursor(platform);
|
|
|