| 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/root_node_manager.h" | 5 #include "mojo/services/view_manager/root_node_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" | 8 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" |
| 9 #include "mojo/services/view_manager/view_manager_connection.h" | 9 #include "mojo/services/view_manager/view_manager_connection.h" |
| 10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 change_source_ = 0; | 160 change_source_ = 0; |
| 161 is_processing_delete_node_ = false; | 161 is_processing_delete_node_ = false; |
| 162 if (change_type == CHANGE_TYPE_ADVANCE_SERVER_CHANGE_ID) | 162 if (change_type == CHANGE_TYPE_ADVANCE_SERVER_CHANGE_ID) |
| 163 next_server_change_id_++; | 163 next_server_change_id_++; |
| 164 } | 164 } |
| 165 | 165 |
| 166 ViewManagerConnection* RootNodeManager::ConnectImpl( | 166 ViewManagerConnection* RootNodeManager::ConnectImpl( |
| 167 const String& url, | 167 const String& url, |
| 168 const Array<TransportNodeId>& node_ids) { | 168 const Array<TransportNodeId>& node_ids) { |
| 169 MessagePipe pipe; | 169 MessagePipe pipe; |
| 170 service_provider_->ConnectToService(url, pipe.handle1.Pass()); | 170 service_provider_->ConnectToService( |
| 171 url, ViewManagerConnection::Client::Name_, pipe.handle1.Pass()); |
| 171 ViewManagerConnection* connection = new ViewManagerConnection(this); | 172 ViewManagerConnection* connection = new ViewManagerConnection(this); |
| 172 connection->SetRoots(node_ids); | 173 connection->SetRoots(node_ids); |
| 173 BindToPipe(connection, pipe.handle0.Pass()); | 174 BindToPipe(connection, pipe.handle0.Pass()); |
| 174 connections_created_by_connect_.insert(connection); | 175 connections_created_by_connect_.insert(connection); |
| 175 return connection; | 176 return connection; |
| 176 } | 177 } |
| 177 | 178 |
| 178 void RootNodeManager::OnNodeHierarchyChanged(const Node* node, | 179 void RootNodeManager::OnNodeHierarchyChanged(const Node* node, |
| 179 const Node* new_parent, | 180 const Node* new_parent, |
| 180 const Node* old_parent) { | 181 const Node* old_parent) { |
| 181 if (!root_view_manager_.in_setup()) | 182 if (!root_view_manager_.in_setup()) |
| 182 ProcessNodeHierarchyChanged(node, new_parent, old_parent); | 183 ProcessNodeHierarchyChanged(node, new_parent, old_parent); |
| 183 } | 184 } |
| 184 | 185 |
| 185 void RootNodeManager::OnNodeViewReplaced(const Node* node, | 186 void RootNodeManager::OnNodeViewReplaced(const Node* node, |
| 186 const View* new_view, | 187 const View* new_view, |
| 187 const View* old_view) { | 188 const View* old_view) { |
| 188 ProcessNodeViewReplaced(node, new_view, old_view); | 189 ProcessNodeViewReplaced(node, new_view, old_view); |
| 189 } | 190 } |
| 190 | 191 |
| 191 } // namespace service | 192 } // namespace service |
| 192 } // namespace view_manager | 193 } // namespace view_manager |
| 193 } // namespace mojo | 194 } // namespace mojo |
| OLD | NEW |