Commit 1208732e authored by Henrique Ferreiro's avatar Henrique Ferreiro Committed by Commit Bot

Remove unneeded CursorLoaderWin::SetPlatformWindow calls

SetCursorNative is only called from WindowTreeHost::SetCursor, which
guarantees that the platform cursor has been set.

Bug: 1097556
Change-Id: I4c140a872482ba33bf957ed6817279c275bf7f36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2417893Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Cr-Commit-Position: refs/heads/master@{#810120}
parent b04d04f1
......@@ -221,6 +221,10 @@ void WindowTreeHost::ConvertPixelsToDIP(gfx::Point* point) const {
}
void WindowTreeHost::SetCursor(gfx::NativeCursor cursor) {
// Some CursorFactory implementations use nullptr to represent the hidden
// cursor (i.e. cursor type kNone).
DCHECK(cursor.type() == ui::mojom::CursorType::kNone || cursor.platform());
last_cursor_ = cursor;
// A lot of code seems to depend on NULL cursors actually showing an arrow,
// so just pass everything along to the host.
......
......@@ -136,11 +136,12 @@ class AURA_EXPORT WindowTreeHost : public ui::internal::InputMethodDelegate,
// root window's.
virtual void ConvertPixelsToDIP(gfx::Point* point) const;
// Cursor.
// Sets the currently-displayed cursor. If the cursor was previously hidden
// via ShowCursor(false), it will remain hidden until ShowCursor(true) is
// called, at which point the cursor that was last set via SetCursor() will be
// used.
// `cursor` should have its platform cursor set, e.g. via
// `CursorLoader::SetPlatformCursor`.
void SetCursor(gfx::NativeCursor cursor);
// Invoked when the cursor's visibility has changed.
......
......@@ -34,7 +34,6 @@
#endif
#if defined(OS_WIN)
#include "ui/base/cursor/cursor_loader_win.h"
#include "ui/platform_window/win/win_window.h"
#endif
......@@ -185,11 +184,6 @@ void WindowTreeHostPlatform::SetCursorNative(gfx::NativeCursor cursor) {
return;
current_cursor_ = cursor;
#if defined(OS_WIN)
ui::CursorLoaderWin cursor_loader;
cursor_loader.SetPlatformCursor(&cursor);
#endif
platform_window_->SetCursor(cursor.platform());
}
......
......@@ -22,7 +22,6 @@
#include "ui/aura/client/focus_client.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/class_property.h"
#include "ui/base/cursor/cursor_loader_win.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/win/event_creation_utils.h"
......@@ -632,9 +631,6 @@ DesktopWindowTreeHostWin::GetKeyboardLayoutMap() {
void DesktopWindowTreeHostWin::SetCursorNative(gfx::NativeCursor cursor) {
TRACE_EVENT1("ui,input", "DesktopWindowTreeHostWin::SetCursorNative",
"cursor", cursor.type());
ui::CursorLoaderWin cursor_loader;
cursor_loader.SetPlatformCursor(&cursor);
message_handler_->SetCursor(cursor.platform());
}
......
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