| OLD | NEW |
| 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 "components/mus/ws/window_tree.h" | 5 #include "components/mus/ws/window_tree.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 ServerWindow* window = | 1294 ServerWindow* window = |
| 1295 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1295 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1296 if (!window || !access_policy_->CanSetClientArea(window)) | 1296 if (!window || !access_policy_->CanSetClientArea(window)) |
| 1297 return; | 1297 return; |
| 1298 | 1298 |
| 1299 std::vector<gfx::Rect> additional_client_areas = | 1299 std::vector<gfx::Rect> additional_client_areas = |
| 1300 transport_additional_client_areas.To<std::vector<gfx::Rect>>(); | 1300 transport_additional_client_areas.To<std::vector<gfx::Rect>>(); |
| 1301 window->SetClientArea(insets.To<gfx::Insets>(), additional_client_areas); | 1301 window->SetClientArea(insets.To<gfx::Insets>(), additional_client_areas); |
| 1302 } | 1302 } |
| 1303 | 1303 |
| 1304 void WindowTree::SetHitTestMask(Id transport_window_id, mojo::RectPtr mask) { |
| 1305 ServerWindow* window = |
| 1306 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1307 if (!window || !access_policy_->CanSetHitTestMask(window)) { |
| 1308 DVLOG(1) << "SetHitTestMask failed"; |
| 1309 return; |
| 1310 } |
| 1311 |
| 1312 window->set_hit_test_mask(mask.To<gfx::Rect>()); |
| 1313 } |
| 1314 |
| 1304 void WindowTree::Embed(Id transport_window_id, | 1315 void WindowTree::Embed(Id transport_window_id, |
| 1305 mojom::WindowTreeClientPtr client, | 1316 mojom::WindowTreeClientPtr client, |
| 1306 const EmbedCallback& callback) { | 1317 const EmbedCallback& callback) { |
| 1307 callback.Run(Embed(ClientWindowId(transport_window_id), std::move(client))); | 1318 callback.Run(Embed(ClientWindowId(transport_window_id), std::move(client))); |
| 1308 } | 1319 } |
| 1309 | 1320 |
| 1310 void WindowTree::SetFocus(uint32_t change_id, Id transport_window_id) { | 1321 void WindowTree::SetFocus(uint32_t change_id, Id transport_window_id) { |
| 1311 client()->OnChangeCompleted(change_id, | 1322 client()->OnChangeCompleted(change_id, |
| 1312 SetFocus(ClientWindowId(transport_window_id))); | 1323 SetFocus(ClientWindowId(transport_window_id))); |
| 1313 } | 1324 } |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1465 } | 1476 } |
| 1466 | 1477 |
| 1467 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( | 1478 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( |
| 1468 const ServerWindow* window) const { | 1479 const ServerWindow* window) const { |
| 1469 WindowTree* tree = window_server_->GetTreeWithRoot(window); | 1480 WindowTree* tree = window_server_->GetTreeWithRoot(window); |
| 1470 return tree && tree != this; | 1481 return tree && tree != this; |
| 1471 } | 1482 } |
| 1472 | 1483 |
| 1473 } // namespace ws | 1484 } // namespace ws |
| 1474 } // namespace mus | 1485 } // namespace mus |
| OLD | NEW |