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

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

Issue 2840043003: chromeos: Makes mushrome use simplified display management (Closed)
Patch Set: make virtual terminal work Created 3 years, 8 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 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 frame_sink_manager_->DropTemporaryReference(surface_info.id()); 819 frame_sink_manager_->DropTemporaryReference(surface_info.id());
820 return; 820 return;
821 } 821 }
822 822
823 // This is only used for testing to observe that a window has a 823 // This is only used for testing to observe that a window has a
824 // CompositorFrame. 824 // CompositorFrame.
825 if (!window_paint_callback_.is_null()) 825 if (!window_paint_callback_.is_null())
826 window_paint_callback_.Run(window); 826 window_paint_callback_.Run(window);
827 827
828 auto* display = display_manager_->GetDisplayContaining(window); 828 auto* display = display_manager_->GetDisplayContaining(window);
829 if (display && window == display->GetActiveRootWindow()) { 829 WindowManagerDisplayRoot* display_root =
830 display ? display->GetActiveWindowManagerDisplayRoot() : nullptr;
831 if (display_root && (window == display_root->root() ||
kylechar 2017/04/26 16:41:44 Can you pull some of this conditional out into oth
sky 2017/04/26 19:36:42 Done.
832 (!display_root->window_manager_state()
833 ->window_tree()
834 ->automatically_create_display_roots() &&
835 window->parent() == display_root->root()))) {
830 // A new surface for a WindowManager root has been created. This is a 836 // A new surface for a WindowManager root has been created. This is a
831 // special case because ServerWindows created by the WindowServer are not 837 // special case because ServerWindows created by the WindowServer are not
832 // part of a WindowTree. Send the SurfaceId directly to FrameGenerator and 838 // part of a WindowTree. Send the SurfaceId directly to FrameGenerator and
833 // claim the temporary reference for the display root. 839 // claim the temporary reference for the display root.
834 display->platform_display()->GetFrameGenerator()->OnSurfaceCreated( 840 display->platform_display()->GetFrameGenerator()->OnSurfaceCreated(
835 surface_info); 841 surface_info);
836 display->root_window() 842 display->root_window()
837 ->GetOrCreateCompositorFrameSinkManager() 843 ->GetOrCreateCompositorFrameSinkManager()
838 ->ClaimTemporaryReference(surface_info.id()); 844 ->ClaimTemporaryReference(surface_info.id());
839 return; 845 return;
(...skipping 16 matching lines...) Expand all
856 void WindowServer::OnUserIdAdded(const UserId& id) { 862 void WindowServer::OnUserIdAdded(const UserId& id) {
857 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); 863 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr);
858 } 864 }
859 865
860 void WindowServer::OnUserIdRemoved(const UserId& id) { 866 void WindowServer::OnUserIdRemoved(const UserId& id) {
861 activity_monitor_map_.erase(id); 867 activity_monitor_map_.erase(id);
862 } 868 }
863 869
864 } // namespace ws 870 } // namespace ws
865 } // namespace ui 871 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698