Commit 90a4b1e0 authored by Nina Satragno's avatar Nina Satragno Committed by Commit Bot

Revert "Remove unneeded CursorLoaderWin::SetPlatformWindow calls"

This reverts commit 1208732e.

Reason for revert: likely making
ExecuteScriptApiTest.ExecuteScriptInFrame flaky.

Bug: 1131966

Original change's description:
> 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/+/2417893
> Reviewed-by: Scott Violet <sky@chromium.org>
> Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
> Cr-Commit-Position: refs/heads/master@{#810120}

TBR=sky@chromium.org,hferreiro@igalia.com

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