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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->display()->UpdateNativeCursor( | 602 display_root->window_manager_state()->cursor_state().SetCurrentWindowCursor( |
603 event_dispatcher->GetCurrentMouseCursor()); | 603 event_dispatcher->GetCurrentMouseCursor()); |
604 } | 604 } |
605 } | 605 } |
606 | 606 |
607 void WindowServer::UpdateNativeCursorIfOver(ServerWindow* window) { | 607 void WindowServer::UpdateNativeCursorIfOver(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 return; | 611 return; |
612 | 612 |
613 EventDispatcher* event_dispatcher = | 613 EventDispatcher* event_dispatcher = |
614 display_root->window_manager_state()->event_dispatcher(); | 614 display_root->window_manager_state()->event_dispatcher(); |
615 if (window != event_dispatcher->GetWindowForMouseCursor()) | 615 if (window != event_dispatcher->GetWindowForMouseCursor()) |
616 return; | 616 return; |
617 | 617 |
618 event_dispatcher->UpdateNonClientAreaForCurrentWindow(); | 618 event_dispatcher->UpdateNonClientAreaForCurrentWindow(); |
619 display_root->display()->UpdateNativeCursor( | 619 display_root->window_manager_state()->cursor_state().SetCurrentWindowCursor( |
620 event_dispatcher->GetCurrentMouseCursor()); | 620 event_dispatcher->GetCurrentMouseCursor()); |
621 } | 621 } |
622 | 622 |
623 bool WindowServer::IsUserInHighContrastMode(const UserId& user) const { | 623 bool WindowServer::IsUserInHighContrastMode(const UserId& user) const { |
624 const auto iter = high_contrast_mode_.find(user); | 624 const auto iter = high_contrast_mode_.find(user); |
625 return (iter == high_contrast_mode_.end()) ? false : iter->second; | 625 return (iter == high_contrast_mode_.end()) ? false : iter->second; |
626 } | 626 } |
627 | 627 |
628 void WindowServer::HandleTemporaryReferenceForNewSurface( | 628 void WindowServer::HandleTemporaryReferenceForNewSurface( |
629 const cc::SurfaceId& surface_id, | 629 const cc::SurfaceId& surface_id, |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 void WindowServer::OnUserIdAdded(const UserId& id) { | 871 void WindowServer::OnUserIdAdded(const UserId& id) { |
872 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 872 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
873 } | 873 } |
874 | 874 |
875 void WindowServer::OnUserIdRemoved(const UserId& id) { | 875 void WindowServer::OnUserIdRemoved(const UserId& id) { |
876 activity_monitor_map_.erase(id); | 876 activity_monitor_map_.erase(id); |
877 } | 877 } |
878 | 878 |
879 } // namespace ws | 879 } // namespace ws |
880 } // namespace ui | 880 } // namespace ui |
OLD | NEW |