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_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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 current_operation_ = nullptr; | 604 current_operation_ = nullptr; |
605 } | 605 } |
606 | 606 |
607 void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) { | 607 void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) { |
608 WindowManagerDisplayRoot* display_root = | 608 WindowManagerDisplayRoot* display_root = |
609 display_manager_->GetWindowManagerDisplayRoot(window); | 609 display_manager_->GetWindowManagerDisplayRoot(window); |
610 if (display_root) { | 610 if (display_root) { |
611 EventDispatcher* event_dispatcher = | 611 EventDispatcher* event_dispatcher = |
612 display_root->window_manager_state()->event_dispatcher(); | 612 display_root->window_manager_state()->event_dispatcher(); |
613 event_dispatcher->UpdateCursorProviderByLastKnownLocation(); | 613 event_dispatcher->UpdateCursorProviderByLastKnownLocation(); |
614 display_root->window_manager_state()->cursor_state().SetCurrentWindowCursor( | |
615 event_dispatcher->GetCurrentMouseCursor()); | |
616 } | 614 } |
617 } | 615 } |
618 | 616 |
619 void WindowServer::UpdateNativeCursorIfOver(ServerWindow* window) { | 617 void WindowServer::UpdateNativeCursorIfOver(ServerWindow* window) { |
620 WindowManagerDisplayRoot* display_root = | 618 WindowManagerDisplayRoot* display_root = |
621 display_manager_->GetWindowManagerDisplayRoot(window); | 619 display_manager_->GetWindowManagerDisplayRoot(window); |
622 if (!display_root) | 620 if (!display_root) |
623 return; | 621 return; |
624 | 622 |
625 EventDispatcher* event_dispatcher = | 623 EventDispatcher* event_dispatcher = |
626 display_root->window_manager_state()->event_dispatcher(); | 624 display_root->window_manager_state()->event_dispatcher(); |
627 if (window != event_dispatcher->GetWindowForMouseCursor()) | 625 if (window != event_dispatcher->GetWindowForMouseCursor()) |
628 return; | 626 return; |
629 | 627 |
630 event_dispatcher->UpdateNonClientAreaForCurrentWindow(); | 628 event_dispatcher->UpdateNonClientAreaForCurrentWindow(); |
631 display_root->window_manager_state()->cursor_state().SetCurrentWindowCursor( | |
632 event_dispatcher->GetCurrentMouseCursor()); | |
633 } | 629 } |
634 | 630 |
635 bool WindowServer::IsUserInHighContrastMode(const UserId& user) const { | 631 bool WindowServer::IsUserInHighContrastMode(const UserId& user) const { |
636 const auto iter = high_contrast_mode_.find(user); | 632 const auto iter = high_contrast_mode_.find(user); |
637 return (iter == high_contrast_mode_.end()) ? false : iter->second; | 633 return (iter == high_contrast_mode_.end()) ? false : iter->second; |
638 } | 634 } |
639 | 635 |
640 void WindowServer::HandleTemporaryReferenceForNewSurface( | 636 void WindowServer::HandleTemporaryReferenceForNewSurface( |
641 const cc::SurfaceId& surface_id, | 637 const cc::SurfaceId& surface_id, |
642 ServerWindow* window) { | 638 ServerWindow* window) { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 void WindowServer::OnUserIdAdded(const UserId& id) { | 879 void WindowServer::OnUserIdAdded(const UserId& id) { |
884 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 880 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
885 } | 881 } |
886 | 882 |
887 void WindowServer::OnUserIdRemoved(const UserId& id) { | 883 void WindowServer::OnUserIdRemoved(const UserId& id) { |
888 activity_monitor_map_.erase(id); | 884 activity_monitor_map_.erase(id); |
889 } | 885 } |
890 | 886 |
891 } // namespace ws | 887 } // namespace ws |
892 } // namespace ui | 888 } // namespace ui |
OLD | NEW |