OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/ws/window_tree.h" | 5 #include "services/ui/ws/window_tree.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2300 DCHECK(window_manager_state_); | 2300 DCHECK(window_manager_state_); |
2301 ServerWindow* window = GetWindowByClientId(ClientWindowId(window_id)); | 2301 ServerWindow* window = GetWindowByClientId(ClientWindowId(window_id)); |
2302 if (!window) { | 2302 if (!window) { |
2303 DVLOG(1) << "WmSetNonClientCursor failed (invalid window id)"; | 2303 DVLOG(1) << "WmSetNonClientCursor failed (invalid window id)"; |
2304 return; | 2304 return; |
2305 } | 2305 } |
2306 | 2306 |
2307 window->SetNonClientCursor(std::move(cursor)); | 2307 window->SetNonClientCursor(std::move(cursor)); |
2308 } | 2308 } |
2309 | 2309 |
| 2310 void WindowTree::WmLockCursor() { |
| 2311 DCHECK(window_manager_state_); |
| 2312 for (Display* display : display_manager()->displays()) |
| 2313 display->LockCursor(); |
| 2314 } |
| 2315 |
| 2316 void WindowTree::WmUnlockCursor() { |
| 2317 DCHECK(window_manager_state_); |
| 2318 for (Display* display : display_manager()->displays()) |
| 2319 display->UnlockCursor(); |
| 2320 } |
| 2321 |
| 2322 void WindowTree::WmShowCursor() { |
| 2323 DCHECK(window_manager_state_); |
| 2324 for (Display* display : display_manager()->displays()) |
| 2325 display->ShowCursor(); |
| 2326 } |
| 2327 |
| 2328 void WindowTree::WmHideCursor() { |
| 2329 DCHECK(window_manager_state_); |
| 2330 for (Display* display : display_manager()->displays()) |
| 2331 display->HideCursor(); |
| 2332 } |
| 2333 |
| 2334 void WindowTree::WmSetGlobalOverrideCursor( |
| 2335 base::Optional<ui::CursorData> cursor) { |
| 2336 DCHECK(window_manager_state_); |
| 2337 for (Display* display : display_manager()->displays()) |
| 2338 display->SetGlobalOverrideCursor(cursor); |
| 2339 } |
| 2340 |
2310 void WindowTree::OnWmCreatedTopLevelWindow(uint32_t change_id, | 2341 void WindowTree::OnWmCreatedTopLevelWindow(uint32_t change_id, |
2311 Id transport_window_id) { | 2342 Id transport_window_id) { |
2312 ServerWindow* window = | 2343 ServerWindow* window = |
2313 GetWindowByClientId(ClientWindowId(transport_window_id)); | 2344 GetWindowByClientId(ClientWindowId(transport_window_id)); |
2314 if (window && window->id().client_id != id_) { | 2345 if (window && window->id().client_id != id_) { |
2315 DVLOG(1) << "OnWmCreatedTopLevelWindow failed (invalid window id)"; | 2346 DVLOG(1) << "OnWmCreatedTopLevelWindow failed (invalid window id)"; |
2316 window_server_->WindowManagerSentBogusMessage(); | 2347 window_server_->WindowManagerSentBogusMessage(); |
2317 window = nullptr; | 2348 window = nullptr; |
2318 } | 2349 } |
2319 if (window) { | 2350 if (window) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2483 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2514 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
2484 effect_bitmask, callback); | 2515 effect_bitmask, callback); |
2485 } | 2516 } |
2486 | 2517 |
2487 void WindowTree::PerformOnDragDropDone() { | 2518 void WindowTree::PerformOnDragDropDone() { |
2488 client()->OnDragDropDone(); | 2519 client()->OnDragDropDone(); |
2489 } | 2520 } |
2490 | 2521 |
2491 } // namespace ws | 2522 } // namespace ws |
2492 } // namespace ui | 2523 } // namespace ui |
OLD | NEW |