| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 const Node* parent = node->GetParent(); | 442 const Node* parent = node->GetParent(); |
| 443 // If the parent isn't known, it means the parent is not visible to us (not | 443 // If the parent isn't known, it means the parent is not visible to us (not |
| 444 // in roots), and should not be sent over. | 444 // in roots), and should not be sent over. |
| 445 if (parent && known_nodes_.count(NodeIdToTransportId(parent->id())) == 0) | 445 if (parent && known_nodes_.count(NodeIdToTransportId(parent->id())) == 0) |
| 446 parent = NULL; | 446 parent = NULL; |
| 447 node_builder.set_parent_id(NodeIdToTransportId( | 447 node_builder.set_parent_id(NodeIdToTransportId( |
| 448 parent ? parent->id() : NodeId())); | 448 parent ? parent->id() : NodeId())); |
| 449 node_builder.set_node_id(NodeIdToTransportId(node->id())); | 449 node_builder.set_node_id(NodeIdToTransportId(node->id())); |
| 450 node_builder.set_view_id(ViewIdToTransportId( | 450 node_builder.set_view_id(ViewIdToTransportId( |
| 451 node->view() ? node->view()->id() : ViewId())); | 451 node->view() ? node->view()->id() : ViewId())); |
| 452 node_builder.set_bounds(node->bounds()); |
| 452 array_builder[i] = node_builder.Finish(); | 453 array_builder[i] = node_builder.Finish(); |
| 453 } | 454 } |
| 454 return array_builder.Finish(); | 455 return array_builder.Finish(); |
| 455 } | 456 } |
| 456 | 457 |
| 457 void ViewManagerConnection::CreateNode( | 458 void ViewManagerConnection::CreateNode( |
| 458 TransportNodeId transport_node_id, | 459 TransportNodeId transport_node_id, |
| 459 const Callback<void(bool)>& callback) { | 460 const Callback<void(bool)>& callback) { |
| 460 const NodeId node_id(NodeIdFromTransportId(transport_node_id)); | 461 const NodeId node_id(NodeIdFromTransportId(transport_node_id)); |
| 461 if (node_id.connection_id != id_ || | 462 if (node_id.connection_id != id_ || |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 | 630 |
| 630 void ViewManagerConnection::OnNodeViewReplaced(const Node* node, | 631 void ViewManagerConnection::OnNodeViewReplaced(const Node* node, |
| 631 const View* new_view, | 632 const View* new_view, |
| 632 const View* old_view) { | 633 const View* old_view) { |
| 633 root_node_manager_->ProcessNodeViewReplaced(node, new_view, old_view); | 634 root_node_manager_->ProcessNodeViewReplaced(node, new_view, old_view); |
| 634 } | 635 } |
| 635 | 636 |
| 636 } // namespace service | 637 } // namespace service |
| 637 } // namespace view_manager | 638 } // namespace view_manager |
| 638 } // namespace mojo | 639 } // namespace mojo |
| OLD | NEW |