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 "mojo/services/view_manager/view_manager_connection.h" | 5 #include "mojo/services/view_manager/view_manager_connection.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "mojo/geometry/geometry_type_converters.h" | 8 #include "mojo/geometry/geometry_type_converters.h" |
9 #include "mojo/public/cpp/bindings/allocation_scope.h" | 9 #include "mojo/public/cpp/bindings/allocation_scope.h" |
10 #include "mojo/services/view_manager/node.h" | 10 #include "mojo/services/view_manager/node.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 const Node* parent = node->GetParent(); | 429 const Node* parent = node->GetParent(); |
430 // If the parent isn't known, it means the parent is not visible to us (not | 430 // If the parent isn't known, it means the parent is not visible to us (not |
431 // in roots), and should not be sent over. | 431 // in roots), and should not be sent over. |
432 if (parent && known_nodes_.count(NodeIdToTransportId(parent->id())) == 0) | 432 if (parent && known_nodes_.count(NodeIdToTransportId(parent->id())) == 0) |
433 parent = NULL; | 433 parent = NULL; |
434 node_builder.set_parent_id(NodeIdToTransportId( | 434 node_builder.set_parent_id(NodeIdToTransportId( |
435 parent ? parent->id() : NodeId())); | 435 parent ? parent->id() : NodeId())); |
436 node_builder.set_node_id(NodeIdToTransportId(node->id())); | 436 node_builder.set_node_id(NodeIdToTransportId(node->id())); |
437 node_builder.set_view_id(ViewIdToTransportId( | 437 node_builder.set_view_id(ViewIdToTransportId( |
438 node->view() ? node->view()->id() : ViewId())); | 438 node->view() ? node->view()->id() : ViewId())); |
| 439 node_builder.set_bounds(node->bounds()); |
439 array_builder[i] = node_builder.Finish(); | 440 array_builder[i] = node_builder.Finish(); |
440 } | 441 } |
441 return array_builder.Finish(); | 442 return array_builder.Finish(); |
442 } | 443 } |
443 | 444 |
444 void ViewManagerConnection::CreateNode( | 445 void ViewManagerConnection::CreateNode( |
445 TransportNodeId transport_node_id, | 446 TransportNodeId transport_node_id, |
446 const Callback<void(bool)>& callback) { | 447 const Callback<void(bool)>& callback) { |
447 const NodeId node_id(NodeIdFromTransportId(transport_node_id)); | 448 const NodeId node_id(NodeIdFromTransportId(transport_node_id)); |
448 if (node_id.connection_id != id_ || | 449 if (node_id.connection_id != id_ || |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 AllocationScope allocation_scope; | 635 AllocationScope allocation_scope; |
635 client()->OnViewManagerConnectionEstablished( | 636 client()->OnViewManagerConnectionEstablished( |
636 id_, | 637 id_, |
637 root_node_manager_->next_server_change_id(), | 638 root_node_manager_->next_server_change_id(), |
638 NodesToINodes(to_send)); | 639 NodesToINodes(to_send)); |
639 } | 640 } |
640 | 641 |
641 } // namespace service | 642 } // namespace service |
642 } // namespace view_manager | 643 } // namespace view_manager |
643 } // namespace mojo | 644 } // namespace mojo |
OLD | NEW |