| 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 "services/ui/ws/window_tree.h" | 5 #include "services/ui/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 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 } | 1285 } |
| 1286 | 1286 |
| 1287 void WindowTree::AttachSurface(Id transport_window_id, | 1287 void WindowTree::AttachSurface(Id transport_window_id, |
| 1288 mojom::SurfaceType type, | 1288 mojom::SurfaceType type, |
| 1289 mojo::InterfaceRequest<mojom::Surface> surface, | 1289 mojo::InterfaceRequest<mojom::Surface> surface, |
| 1290 mojom::SurfaceClientPtr client) { | 1290 mojom::SurfaceClientPtr client) { |
| 1291 ServerWindow* window = | 1291 ServerWindow* window = |
| 1292 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1292 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1293 const bool success = | 1293 const bool success = |
| 1294 window && access_policy_->CanSetWindowSurface(window, type); | 1294 window && access_policy_->CanSetWindowSurface(window, type); |
| 1295 if (!success) | 1295 if (!success) { |
| 1296 DVLOG(1) << "request to AttachSurface failed"; |
| 1296 return; | 1297 return; |
| 1298 } |
| 1297 window->CreateSurface(type, std::move(surface), std::move(client)); | 1299 window->CreateSurface(type, std::move(surface), std::move(client)); |
| 1298 } | 1300 } |
| 1299 | 1301 |
| 1300 void WindowTree::SetWindowTextInputState(Id transport_window_id, | 1302 void WindowTree::SetWindowTextInputState(Id transport_window_id, |
| 1301 mojo::TextInputStatePtr state) { | 1303 mojo::TextInputStatePtr state) { |
| 1302 ServerWindow* window = | 1304 ServerWindow* window = |
| 1303 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1305 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1304 bool success = window && access_policy_->CanSetWindowTextInputState(window); | 1306 bool success = window && access_policy_->CanSetWindowTextInputState(window); |
| 1305 if (success) | 1307 if (success) |
| 1306 window->SetTextInputState(state.To<ui::TextInputState>()); | 1308 window->SetTextInputState(state.To<ui::TextInputState>()); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1674 } | 1676 } |
| 1675 | 1677 |
| 1676 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( | 1678 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( |
| 1677 const ServerWindow* window) const { | 1679 const ServerWindow* window) const { |
| 1678 WindowTree* tree = window_server_->GetTreeWithRoot(window); | 1680 WindowTree* tree = window_server_->GetTreeWithRoot(window); |
| 1679 return tree && tree != this; | 1681 return tree && tree != this; |
| 1680 } | 1682 } |
| 1681 | 1683 |
| 1682 } // namespace ws | 1684 } // namespace ws |
| 1683 } // namespace ui | 1685 } // namespace ui |
| OLD | NEW |