Commit 629ac92f authored by Henrique Ferreiro's avatar Henrique Ferreiro Committed by Commit Bot

Remove CursorLoader from MouseCursorOverlayControllerAura

CursorLoader caches cursors, so it should only be used from a single
place, the NativeCursorManager implementations.

In this case, CursorLoader::SetPlatformCursor() isn't needed anyway,
because the cursor is just used to obtain its bitmap and hotspot via
GetCursorBitmap/Hotspot, and those don't need the platform cursor.

Bug: 1097556
Change-Id: I32e2a867ec2b15374e545d1b268c7f427cd8fab0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2256220
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: default avatarmark a. foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781221}
parent a0c50db3
...@@ -16,17 +16,6 @@ ...@@ -16,17 +16,6 @@
namespace content { namespace content {
namespace {
ui::Cursor CreateDefaultPointerCursor() {
ui::Cursor cursor(ui::mojom::CursorType::kPointer);
std::unique_ptr<ui::CursorLoader> loader(ui::CursorLoader::Create());
loader->SetPlatformCursor(&cursor);
return cursor;
}
} // namespace
class MouseCursorOverlayController::Observer : public ui::EventHandler, class MouseCursorOverlayController::Observer : public ui::EventHandler,
public aura::WindowObserver { public aura::WindowObserver {
public: public:
...@@ -167,7 +156,7 @@ gfx::NativeCursor MouseCursorOverlayController::GetCurrentCursorOrDefault() ...@@ -167,7 +156,7 @@ gfx::NativeCursor MouseCursorOverlayController::GetCurrentCursorOrDefault()
} }
} }
return CreateDefaultPointerCursor(); return ui::mojom::CursorType::kPointer;
} }
gfx::RectF MouseCursorOverlayController::ComputeRelativeBoundsForOverlay( gfx::RectF MouseCursorOverlayController::ComputeRelativeBoundsForOverlay(
...@@ -212,13 +201,9 @@ void MouseCursorOverlayController::DisconnectFromToolkitForTesting() { ...@@ -212,13 +201,9 @@ void MouseCursorOverlayController::DisconnectFromToolkitForTesting() {
observer_->StopTracking(); observer_->StopTracking();
// The default cursor is ui::mojom::CursorType::kNone. Make it kPointer so // Note: Not overriding the mouse cursor since the default is already
// the tests have a non-empty cursor bitmap to work with. // ui::mojom::CursorType::kPointer, which provides the tests a bitmap they can
auto* const window = Observer::GetTargetWindow(observer_); // work with.
CHECK(window);
auto* const host = window->GetHost();
CHECK(host);
host->SetCursor(CreateDefaultPointerCursor());
} }
// static // static
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment