Index: ui/views/mus/platform_window_mus.cc |
diff --git a/ui/views/mus/platform_window_mus.cc b/ui/views/mus/platform_window_mus.cc |
index 132e4b4e7f6ae5ef0f103a25845898c9c2a6ace8..5111b705126743cdd344ea588be0a8063eecde8d 100644 |
--- a/ui/views/mus/platform_window_mus.cc |
+++ b/ui/views/mus/platform_window_mus.cc |
@@ -23,6 +23,7 @@ PlatformWindowMus::PlatformWindowMus(ui::PlatformWindowDelegate* delegate, |
: delegate_(delegate), |
mus_window_(mus_window), |
show_state_(mus::mojom::SHOW_STATE_RESTORED), |
+ last_cursor_(mus::mojom::CURSOR_NULL), |
has_capture_(false) { |
DCHECK(delegate_); |
DCHECK(mus_window_); |
@@ -54,6 +55,17 @@ void PlatformWindowMus::Activate() { |
mus_window_->SetFocus(); |
} |
+void PlatformWindowMus::SetCursorById(mus::mojom::Cursor cursor) { |
+ if (last_cursor_ != cursor) { |
+ // The ui::PlatformWindow interface uses ui::PlatformCursor at this level, |
+ // instead of ui::Cursor. All of the cursor abstractions in ui right now are |
+ // sort of leaky; despite being nominally cross platform, they all drop down |
+ // to platform types almost immediately, which makes them unusable as |
+ // transport types. |
+ mus_window_->SetPredefinedCursor(cursor); |
+ } |
+} |
+ |
void PlatformWindowMus::Show() { |
mus_window_->SetVisible(true); |
} |
@@ -147,6 +159,13 @@ void PlatformWindowMus::OnWindowFocusChanged(mus::Window* gained_focus, |
delegate_->OnActivationChanged(false); |
} |
+void PlatformWindowMus::OnWindowPredefinedCursorChanged( |
+ mus::Window* window, |
+ mus::mojom::Cursor cursor) { |
+ DCHECK_EQ(window, mus_window_); |
+ last_cursor_ = cursor; |
+} |
+ |
void PlatformWindowMus::OnWindowInputEvent(mus::Window* view, |
const mus::mojom::EventPtr& event) { |
scoped_ptr<ui::Event> ui_event(event.To<scoped_ptr<ui::Event>>()); |