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

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

Issue 2297743002: Process DisplaySnapshots in PlatformScreen. (Closed)
Patch Set: Add comment. Created 4 years, 3 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
« no previous file with comments | « services/ui/ws/display_manager.h ('k') | testing/buildbot/chromium.chromiumos.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "services/ui/display/platform_screen.h" 8 #include "services/ui/display/platform_screen.h"
9 #include "services/ui/ws/display.h" 9 #include "services/ui/ws/display.h"
10 #include "services/ui/ws/display_binding.h" 10 #include "services/ui/ws/display_binding.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 const ServerWindow* window) const { 97 const ServerWindow* window) const {
98 while (window && window->parent()) 98 while (window && window->parent())
99 window = window->parent(); 99 window = window->parent();
100 for (Display* display : displays_) { 100 for (Display* display : displays_) {
101 if (window == display->root_window()) 101 if (window == display->root_window())
102 return display; 102 return display;
103 } 103 }
104 return nullptr; 104 return nullptr;
105 } 105 }
106 106
107 Display* DisplayManager::GetDisplayById(int64_t display_id) {
108 for (Display* display : displays_) {
109 if (display->GetId() == display_id)
110 return display;
111 }
112 return nullptr;
113 }
114
107 const WindowManagerDisplayRoot* DisplayManager::GetWindowManagerDisplayRoot( 115 const WindowManagerDisplayRoot* DisplayManager::GetWindowManagerDisplayRoot(
108 const ServerWindow* window) const { 116 const ServerWindow* window) const {
109 const ServerWindow* last = window; 117 const ServerWindow* last = window;
110 while (window && window->parent()) { 118 while (window && window->parent()) {
111 last = window; 119 last = window;
112 window = window->parent(); 120 window = window->parent();
113 } 121 }
114 for (Display* display : displays_) { 122 for (Display* display : displays_) {
115 if (window == display->root_window()) 123 if (window == display->root_window())
116 return display->GetWindowManagerDisplayRootWithRoot(last); 124 return display->GetWindowManagerDisplayRootWithRoot(last);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 params.platform_screen = platform_screen; 176 params.platform_screen = platform_screen;
169 params.surfaces_state = window_server_->GetSurfacesState(); 177 params.surfaces_state = window_server_->GetSurfacesState();
170 178
171 ws::Display* display = new ws::Display(window_server_, params); 179 ws::Display* display = new ws::Display(window_server_, params);
172 display->Init(nullptr); 180 display->Init(nullptr);
173 181
174 window_server_->delegate()->UpdateTouchTransforms(); 182 window_server_->delegate()->UpdateTouchTransforms();
175 } 183 }
176 184
177 void DisplayManager::OnDisplayRemoved(int64_t id) { 185 void DisplayManager::OnDisplayRemoved(int64_t id) {
178 // TODO(kylechar): Implement. 186 Display* display = GetDisplayById(id);
179 NOTREACHED(); 187 if (display)
188 DestroyDisplay(display);
189 // TODO(kylechar): What if the display is still pending?
180 } 190 }
181 191
182 void DisplayManager::OnDisplayModified(int64_t id, const gfx::Rect& bounds) { 192 void DisplayManager::OnDisplayModified(int64_t id, const gfx::Rect& bounds) {
183 // TODO(kylechar): Implement. 193 // TODO(kylechar): Implement.
184 NOTREACHED(); 194 NOTREACHED();
185 } 195 }
186 196
187 } // namespace ws 197 } // namespace ws
188 } // namespace ui 198 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/display_manager.h ('k') | testing/buildbot/chromium.chromiumos.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698