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

Side by Side Diff: services/ui/public/cpp/window_tree_client.cc

Issue 2346253004: Makes display roots be destroyed by client (Closed)
Patch Set: cleanup 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
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/public/cpp/window_tree_client.h" 5 #include "services/ui/public/cpp/window_tree_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 void WindowTreeClient::OnConnect(ClientSpecificId client_id) { 1216 void WindowTreeClient::OnConnect(ClientSpecificId client_id) {
1217 client_id_ = client_id; 1217 client_id_ = client_id;
1218 } 1218 }
1219 1219
1220 void WindowTreeClient::WmNewDisplayAdded(const display::Display& display, 1220 void WindowTreeClient::WmNewDisplayAdded(const display::Display& display,
1221 mojom::WindowDataPtr root_data, 1221 mojom::WindowDataPtr root_data,
1222 bool parent_drawn) { 1222 bool parent_drawn) {
1223 WmNewDisplayAddedImpl(display, std::move(root_data), parent_drawn); 1223 WmNewDisplayAddedImpl(display, std::move(root_data), parent_drawn);
1224 } 1224 }
1225 1225
1226 void WindowTreeClient::WmDisplayRemoved(int64_t display_id) {
1227 DCHECK(window_manager_delegate_);
1228
1229 for (Window* root : roots_) {
1230 if (root->display_id() == display_id) {
1231 window_manager_delegate_->OnWmDisplayRemoved(root);
1232 return;
1233 }
1234 }
1235 }
1236
1226 void WindowTreeClient::WmSetBounds(uint32_t change_id, 1237 void WindowTreeClient::WmSetBounds(uint32_t change_id,
1227 Id window_id, 1238 Id window_id,
1228 const gfx::Rect& transit_bounds) { 1239 const gfx::Rect& transit_bounds) {
1229 Window* window = GetWindowByServerId(window_id); 1240 Window* window = GetWindowByServerId(window_id);
1230 bool result = false; 1241 bool result = false;
1231 if (window) { 1242 if (window) {
1232 DCHECK(window_manager_delegate_); 1243 DCHECK(window_manager_delegate_);
1233 gfx::Rect bounds = transit_bounds; 1244 gfx::Rect bounds = transit_bounds;
1234 result = window_manager_delegate_->OnWmSetBounds(window, &bounds); 1245 result = window_manager_delegate_->OnWmSetBounds(window, &bounds);
1235 if (result) { 1246 if (result) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 Window* window, 1393 Window* window,
1383 const gfx::Vector2d& offset, 1394 const gfx::Vector2d& offset,
1384 const gfx::Insets& hit_area) { 1395 const gfx::Insets& hit_area) {
1385 if (window_manager_internal_client_) { 1396 if (window_manager_internal_client_) {
1386 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( 1397 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea(
1387 server_id(window), offset.x(), offset.y(), hit_area); 1398 server_id(window), offset.x(), offset.y(), hit_area);
1388 } 1399 }
1389 } 1400 }
1390 1401
1391 } // namespace ui 1402 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/window_tree_client.h ('k') | services/ui/public/interfaces/window_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698