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

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

Issue 2474113002: Mus+Ash: Unified BeginFrame Skeleton (Closed)
Patch Set: Remove window_tree.mojom.h Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/display_manager.h" 5 #include "services/ui/ws/display_manager.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "services/ui/display/platform_screen.h" 9 #include "services/ui/display/platform_screen.h"
10 #include "services/ui/ws/display.h" 10 #include "services/ui/ws/display.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 std::set<const Display*> DisplayManager::displays() const { 84 std::set<const Display*> DisplayManager::displays() const {
85 std::set<const Display*> ret_value(displays_.begin(), displays_.end()); 85 std::set<const Display*> ret_value(displays_.begin(), displays_.end());
86 return ret_value; 86 return ret_value;
87 } 87 }
88 88
89 void DisplayManager::OnDisplayUpdate(Display* display) { 89 void DisplayManager::OnDisplayUpdate(Display* display) {
90 for (const auto& pair : user_display_managers_) 90 for (const auto& pair : user_display_managers_)
91 pair.second->OnDisplayUpdate(display); 91 pair.second->OnDisplayUpdate(display);
92 } 92 }
93 93
94 Display* DisplayManager::GetDisplayContaining(ServerWindow* window) { 94 Display* DisplayManager::GetDisplayContaining(const ServerWindow* window) {
95 return const_cast<Display*>( 95 return const_cast<Display*>(
96 static_cast<const DisplayManager*>(this)->GetDisplayContaining(window)); 96 static_cast<const DisplayManager*>(this)->GetDisplayContaining(window));
97 } 97 }
98 98
99 const Display* DisplayManager::GetDisplayContaining( 99 const Display* DisplayManager::GetDisplayContaining(
100 const ServerWindow* window) const { 100 const ServerWindow* window) const {
101 while (window && window->parent()) 101 while (window && window->parent())
102 window = window->parent(); 102 window = window->parent();
103 for (Display* display : displays_) { 103 for (Display* display : displays_) {
104 if (window == display->root_window()) 104 if (window == display->root_window())
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 void DisplayManager::OnPrimaryDisplayChanged(int64_t primary_display_id) { 217 void DisplayManager::OnPrimaryDisplayChanged(int64_t primary_display_id) {
218 // TODO(kylechar): Send IPCs to WM clients first. 218 // TODO(kylechar): Send IPCs to WM clients first.
219 219
220 // Send IPCs to any DisplayManagerObservers. 220 // Send IPCs to any DisplayManagerObservers.
221 for (const auto& pair : user_display_managers_) 221 for (const auto& pair : user_display_managers_)
222 pair.second->OnPrimaryDisplayChanged(primary_display_id); 222 pair.second->OnPrimaryDisplayChanged(primary_display_id);
223 } 223 }
224 224
225 } // namespace ws 225 } // namespace ws
226 } // namespace ui 226 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698