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

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

Issue 2884463002: Make event-targeting asynchronous in window server. (Closed)
Patch Set: comments Created 3 years, 6 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
« no previous file with comments | « services/ui/ws/window_manager_state_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 current_operation_ = nullptr; 614 current_operation_ = nullptr;
615 } 615 }
616 616
617 void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) { 617 void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) {
618 WindowManagerDisplayRoot* display_root = 618 WindowManagerDisplayRoot* display_root =
619 display_manager_->GetWindowManagerDisplayRoot(window); 619 display_manager_->GetWindowManagerDisplayRoot(window);
620 if (display_root) { 620 if (display_root) {
621 EventDispatcher* event_dispatcher = 621 EventDispatcher* event_dispatcher =
622 display_root->window_manager_state()->event_dispatcher(); 622 display_root->window_manager_state()->event_dispatcher();
623 event_dispatcher->UpdateCursorProviderByLastKnownLocation(); 623 event_dispatcher->UpdateCursorProviderByLastKnownLocation();
624 display_root->window_manager_state()->cursor_state().SetCurrentWindowCursor(
625 event_dispatcher->GetCurrentMouseCursor());
626 } 624 }
627 } 625 }
628 626
629 void WindowServer::UpdateNativeCursorIfOver(ServerWindow* window) { 627 void WindowServer::UpdateNativeCursorIfOver(ServerWindow* window) {
630 WindowManagerDisplayRoot* display_root = 628 WindowManagerDisplayRoot* display_root =
631 display_manager_->GetWindowManagerDisplayRoot(window); 629 display_manager_->GetWindowManagerDisplayRoot(window);
632 if (!display_root) 630 if (!display_root)
633 return; 631 return;
634 632
635 EventDispatcher* event_dispatcher = 633 EventDispatcher* event_dispatcher =
636 display_root->window_manager_state()->event_dispatcher(); 634 display_root->window_manager_state()->event_dispatcher();
637 if (window != event_dispatcher->GetWindowForMouseCursor()) 635 if (window != event_dispatcher->GetWindowForMouseCursor())
638 return; 636 return;
639 637
640 event_dispatcher->UpdateNonClientAreaForCurrentWindow(); 638 event_dispatcher->UpdateNonClientAreaForCurrentWindow();
641 display_root->window_manager_state()->cursor_state().SetCurrentWindowCursor(
642 event_dispatcher->GetCurrentMouseCursor());
643 } 639 }
644 640
645 bool WindowServer::IsUserInHighContrastMode(const UserId& user) const { 641 bool WindowServer::IsUserInHighContrastMode(const UserId& user) const {
646 const auto iter = high_contrast_mode_.find(user); 642 const auto iter = high_contrast_mode_.find(user);
647 return (iter == high_contrast_mode_.end()) ? false : iter->second; 643 return (iter == high_contrast_mode_.end()) ? false : iter->second;
648 } 644 }
649 645
650 void WindowServer::HandleTemporaryReferenceForNewSurface( 646 void WindowServer::HandleTemporaryReferenceForNewSurface(
651 const cc::SurfaceId& surface_id, 647 const cc::SurfaceId& surface_id,
652 ServerWindow* window) { 648 ServerWindow* window) {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 void WindowServer::OnUserIdAdded(const UserId& id) { 897 void WindowServer::OnUserIdAdded(const UserId& id) {
902 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); 898 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr);
903 } 899 }
904 900
905 void WindowServer::OnUserIdRemoved(const UserId& id) { 901 void WindowServer::OnUserIdRemoved(const UserId& id) {
906 activity_monitor_map_.erase(id); 902 activity_monitor_map_.erase(id);
907 } 903 }
908 904
909 } // namespace ws 905 } // namespace ws
910 } // namespace ui 906 } // namespace ui
OLDNEW
« no previous file with comments | « 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