Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: services/ui/ws/window_tree.cc

Issue 2857963003: Add {Lock,Unlock,Show,Hide}Cursor() to the window manager mojom. (Closed)
Patch Set: early return -> braces and comment Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 window_manager_state_->cursor_state().LockCursor();
2313 }
2314
2315 void WindowTree::WmUnlockCursor() {
2316 DCHECK(window_manager_state_);
2317 window_manager_state_->cursor_state().UnlockCursor();
2318 }
2319
2320 void WindowTree::WmSetCursorVisible(bool visible) {
2321 DCHECK(window_manager_state_);
2322 window_manager_state_->cursor_state().SetCursorVisible(visible);
2323 }
2324
2325 void WindowTree::WmSetGlobalOverrideCursor(
2326 base::Optional<ui::CursorData> cursor) {
2327 DCHECK(window_manager_state_);
2328 window_manager_state_->cursor_state().SetGlobalOverrideCursor(cursor);
2329 }
2330
2310 void WindowTree::OnWmCreatedTopLevelWindow(uint32_t change_id, 2331 void WindowTree::OnWmCreatedTopLevelWindow(uint32_t change_id,
2311 Id transport_window_id) { 2332 Id transport_window_id) {
2312 ServerWindow* window = 2333 ServerWindow* window =
2313 GetWindowByClientId(ClientWindowId(transport_window_id)); 2334 GetWindowByClientId(ClientWindowId(transport_window_id));
2314 if (window && window->id().client_id != id_) { 2335 if (window && window->id().client_id != id_) {
2315 DVLOG(1) << "OnWmCreatedTopLevelWindow failed (invalid window id)"; 2336 DVLOG(1) << "OnWmCreatedTopLevelWindow failed (invalid window id)";
2316 window_server_->WindowManagerSentBogusMessage(); 2337 window_server_->WindowManagerSentBogusMessage();
2317 window = nullptr; 2338 window = nullptr;
2318 } 2339 }
2319 if (window) { 2340 if (window) {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2483 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, 2504 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset,
2484 effect_bitmask, callback); 2505 effect_bitmask, callback);
2485 } 2506 }
2486 2507
2487 void WindowTree::PerformOnDragDropDone() { 2508 void WindowTree::PerformOnDragDropDone() {
2488 client()->OnDragDropDone(); 2509 client()->OnDragDropDone();
2489 } 2510 }
2490 2511
2491 } // namespace ws 2512 } // namespace ws
2492 } // namespace ui 2513 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698