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

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

Issue 2712203002: c++ / mojo changes for 'external window mode'
Patch Set: addressed sky/fwang feedback (take 5), simpler mus_demo changes / passing unittests Created 3 years, 9 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 569
570 void WindowServer::FinishOperation() { 570 void WindowServer::FinishOperation() {
571 // PrepareForOperation/FinishOperation should be balanced. 571 // PrepareForOperation/FinishOperation should be balanced.
572 CHECK(current_operation_); 572 CHECK(current_operation_);
573 current_operation_ = nullptr; 573 current_operation_ = nullptr;
574 } 574 }
575 575
576 void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) { 576 void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) {
577 WindowManagerDisplayRoot* display_root = 577 WindowManagerDisplayRoot* display_root =
578 display_manager_->GetWindowManagerDisplayRoot(window); 578 display_manager_->GetWindowManagerDisplayRoot(window);
579 if (display_root) { 579 if (display_root && display_root->window_manager_state()) {
580 EventDispatcher* event_dispatcher = 580 EventDispatcher* event_dispatcher =
581 display_root->window_manager_state()->event_dispatcher(); 581 display_root->window_manager_state()->event_dispatcher();
582 event_dispatcher->UpdateCursorProviderByLastKnownLocation(); 582 event_dispatcher->UpdateCursorProviderByLastKnownLocation();
583 display_root->display()->UpdateNativeCursor( 583 display_root->display()->UpdateNativeCursor(
584 event_dispatcher->GetCurrentMouseCursor()); 584 event_dispatcher->GetCurrentMouseCursor());
585 } 585 }
586 } 586 }
587 587
588 void WindowServer::UpdateNativeCursorIfOver(ServerWindow* window) { 588 void WindowServer::UpdateNativeCursorIfOver(ServerWindow* window) {
589 WindowManagerDisplayRoot* display_root = 589 WindowManagerDisplayRoot* display_root =
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 } 655 }
656 656
657 void WindowServer::OnWindowHierarchyChanged(ServerWindow* window, 657 void WindowServer::OnWindowHierarchyChanged(ServerWindow* window,
658 ServerWindow* new_parent, 658 ServerWindow* new_parent,
659 ServerWindow* old_parent) { 659 ServerWindow* old_parent) {
660 if (in_destructor_) 660 if (in_destructor_)
661 return; 661 return;
662 662
663 WindowManagerDisplayRoot* display_root = 663 WindowManagerDisplayRoot* display_root =
664 display_manager_->GetWindowManagerDisplayRoot(window); 664 display_manager_->GetWindowManagerDisplayRoot(window);
665 if (display_root) 665 if (display_root && display_root->window_manager_state())
666 display_root->window_manager_state() 666 display_root->window_manager_state()
667 ->ReleaseCaptureBlockedByAnyModalWindow(); 667 ->ReleaseCaptureBlockedByAnyModalWindow();
668 668
669 ProcessWindowHierarchyChanged(window, new_parent, old_parent); 669 ProcessWindowHierarchyChanged(window, new_parent, old_parent);
670 670
671 if (old_parent) { 671 if (old_parent) {
672 display_compositor_->UnregisterFrameSinkHierarchy( 672 display_compositor_->UnregisterFrameSinkHierarchy(
673 old_parent->frame_sink_id(), window->frame_sink_id()); 673 old_parent->frame_sink_id(), window->frame_sink_id());
674 } 674 }
675 if (new_parent) { 675 if (new_parent) {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 void WindowServer::OnUserIdAdded(const UserId& id) { 850 void WindowServer::OnUserIdAdded(const UserId& id) {
851 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); 851 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr);
852 } 852 }
853 853
854 void WindowServer::OnUserIdRemoved(const UserId& id) { 854 void WindowServer::OnUserIdRemoved(const UserId& id) {
855 activity_monitor_map_.erase(id); 855 activity_monitor_map_.erase(id);
856 } 856 }
857 857
858 } // namespace ws 858 } // namespace ws
859 } // namespace ui 859 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698