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

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

Issue 2884463002: Make event-targeting asynchronous in window server. (Closed)
Patch Set: std::move 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_server.h" 5 #include "services/ui/ws/window_server.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 current_operation_ = nullptr; 592 current_operation_ = nullptr;
593 } 593 }
594 594
595 void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) { 595 void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) {
596 WindowManagerDisplayRoot* display_root = 596 WindowManagerDisplayRoot* display_root =
597 display_manager_->GetWindowManagerDisplayRoot(window); 597 display_manager_->GetWindowManagerDisplayRoot(window);
598 if (display_root) { 598 if (display_root) {
599 EventDispatcher* event_dispatcher = 599 EventDispatcher* event_dispatcher =
600 display_root->window_manager_state()->event_dispatcher(); 600 display_root->window_manager_state()->event_dispatcher();
601 event_dispatcher->UpdateCursorProviderByLastKnownLocation(); 601 event_dispatcher->UpdateCursorProviderByLastKnownLocation();
602 display_root->window_manager_state()->cursor_state().SetCurrentWindowCursor(
603 event_dispatcher->GetCurrentMouseCursor());
604 } 602 }
605 } 603 }
606 604
607 void WindowServer::UpdateNativeCursorIfOver(ServerWindow* window) { 605 void WindowServer::UpdateNativeCursorIfOver(ServerWindow* window) {
608 WindowManagerDisplayRoot* display_root = 606 WindowManagerDisplayRoot* display_root =
609 display_manager_->GetWindowManagerDisplayRoot(window); 607 display_manager_->GetWindowManagerDisplayRoot(window);
610 if (!display_root) 608 if (!display_root)
611 return; 609 return;
612 610
613 EventDispatcher* event_dispatcher = 611 EventDispatcher* event_dispatcher =
614 display_root->window_manager_state()->event_dispatcher(); 612 display_root->window_manager_state()->event_dispatcher();
615 if (window != event_dispatcher->GetWindowForMouseCursor()) 613 if (window != event_dispatcher->GetWindowForMouseCursor())
616 return; 614 return;
617 615
618 event_dispatcher->UpdateNonClientAreaForCurrentWindow(); 616 event_dispatcher->UpdateNonClientAreaForCurrentWindow();
619 display_root->window_manager_state()->cursor_state().SetCurrentWindowCursor(
620 event_dispatcher->GetCurrentMouseCursor());
621 } 617 }
622 618
623 bool WindowServer::IsUserInHighContrastMode(const UserId& user) const { 619 bool WindowServer::IsUserInHighContrastMode(const UserId& user) const {
624 const auto iter = high_contrast_mode_.find(user); 620 const auto iter = high_contrast_mode_.find(user);
625 return (iter == high_contrast_mode_.end()) ? false : iter->second; 621 return (iter == high_contrast_mode_.end()) ? false : iter->second;
626 } 622 }
627 623
628 void WindowServer::HandleTemporaryReferenceForNewSurface( 624 void WindowServer::HandleTemporaryReferenceForNewSurface(
629 const cc::SurfaceId& surface_id, 625 const cc::SurfaceId& surface_id,
630 ServerWindow* window) { 626 ServerWindow* window) {
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 void WindowServer::OnUserIdAdded(const UserId& id) { 867 void WindowServer::OnUserIdAdded(const UserId& id) {
872 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); 868 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr);
873 } 869 }
874 870
875 void WindowServer::OnUserIdRemoved(const UserId& id) { 871 void WindowServer::OnUserIdRemoved(const UserId& id) {
876 activity_monitor_map_.erase(id); 872 activity_monitor_map_.erase(id);
877 } 873 }
878 874
879 } // namespace ws 875 } // namespace ws
880 } // namespace ui 876 } // namespace ui
OLDNEW
« services/ui/ws/event_dispatcher_delegate.h ('K') | « services/ui/ws/window_manager_state_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698