OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/native_cursor_manager_ash_mus.h" | 5 #include "ash/wm/native_cursor_manager_ash_mus.h" |
6 | 6 |
7 #include "ash/display/cursor_window_controller.h" | 7 #include "ash/display/cursor_window_controller.h" |
8 #include "ash/display/window_tree_host_manager.h" | 8 #include "ash/display/window_tree_host_manager.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_port.h" | 10 #include "ash/shell_port.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 SetCursor(delegate->GetCursor(), delegate); | 167 SetCursor(delegate->GetCursor(), delegate); |
168 } else { | 168 } else { |
169 gfx::NativeCursor invisible_cursor(ui::CursorType::kNone); | 169 gfx::NativeCursor invisible_cursor(ui::CursorType::kNone); |
170 image_cursors_->SetPlatformCursor(&invisible_cursor); | 170 image_cursors_->SetPlatformCursor(&invisible_cursor); |
171 SetCursorOnAllRootWindows(invisible_cursor); | 171 SetCursorOnAllRootWindows(invisible_cursor); |
172 } | 172 } |
173 | 173 |
174 NotifyCursorVisibilityChange(visible); | 174 NotifyCursorVisibilityChange(visible); |
175 } | 175 } |
176 | 176 |
177 void NativeCursorManagerAshMus::SetCursorSet( | 177 void NativeCursorManagerAshMus::SetCursorSize( |
178 ui::CursorSetType cursor_set, | 178 ui::CursorSize cursor_size, |
179 ::wm::NativeCursorManagerDelegate* delegate) { | 179 ::wm::NativeCursorManagerDelegate* delegate) { |
180 // We can't just hand this off to ImageCursors like we do in the classic ash | 180 delegate->CommitCursorSize(cursor_size); |
181 // case. We need to collaborate with the mus server to fully implement this. | 181 |
182 NOTIMPLEMENTED(); | 182 ShellPort::Get()->SetCursorSize(cursor_size); |
| 183 |
| 184 Shell::Get() |
| 185 ->window_tree_host_manager() |
| 186 ->cursor_window_controller() |
| 187 ->SetCursorSize(cursor_size); |
183 } | 188 } |
184 | 189 |
185 void NativeCursorManagerAshMus::SetMouseEventsEnabled( | 190 void NativeCursorManagerAshMus::SetMouseEventsEnabled( |
186 bool enabled, | 191 bool enabled, |
187 ::wm::NativeCursorManagerDelegate* delegate) { | 192 ::wm::NativeCursorManagerDelegate* delegate) { |
188 delegate->CommitMouseEventsEnabled(enabled); | 193 delegate->CommitMouseEventsEnabled(enabled); |
189 | 194 |
190 if (enabled) { | 195 if (enabled) { |
191 aura::Env::GetInstance()->set_last_mouse_location( | 196 aura::Env::GetInstance()->set_last_mouse_location( |
192 disabled_cursor_location_); | 197 disabled_cursor_location_); |
193 } else { | 198 } else { |
194 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); | 199 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); |
195 } | 200 } |
196 | 201 |
197 SetVisibility(delegate->IsCursorVisible(), delegate); | 202 SetVisibility(delegate->IsCursorVisible(), delegate); |
198 | 203 |
199 NotifyMouseEventsEnableStateChange(enabled); | 204 NotifyMouseEventsEnableStateChange(enabled); |
200 } | 205 } |
201 | 206 |
202 } // namespace ash | 207 } // namespace ash |
OLD | NEW |