| 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/cpp/application/application_connection.h" | 8 #include "mojo/public/cpp/application/application_connection.h" |
| 9 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" | 9 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" |
| 10 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" | 10 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 connections_created_by_connect_.erase(connection); | 81 connections_created_by_connect_.erase(connection); |
| 82 | 82 |
| 83 // Notify remaining connections so that they can cleanup. | 83 // Notify remaining connections so that they can cleanup. |
| 84 for (ConnectionMap::const_iterator i = connection_map_.begin(); | 84 for (ConnectionMap::const_iterator i = connection_map_.begin(); |
| 85 i != connection_map_.end(); ++i) { | 85 i != connection_map_.end(); ++i) { |
| 86 i->second->OnViewManagerServiceImplDestroyed(connection->id()); | 86 i->second->OnViewManagerServiceImplDestroyed(connection->id()); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 void RootNodeManager::EmbedRoot(const std::string& url) { | 90 void RootNodeManager::EmbedRoot(const std::string& url) { |
| 91 CHECK(connection_map_.empty()); | 91 if (connection_map_.empty()) { |
| 92 EmbedImpl(kRootConnection, String::From(url), InvalidNodeId()); | 92 EmbedImpl(kRootConnection, String::From(url), InvalidNodeId()); |
| 93 return; |
| 94 } |
| 95 ViewManagerServiceImpl* connection = GetConnection(kWindowManagerConnection); |
| 96 connection->client()->EmbedRoot(url); |
| 93 } | 97 } |
| 94 | 98 |
| 95 void RootNodeManager::Embed(ConnectionSpecificId creator_id, | 99 void RootNodeManager::Embed(ConnectionSpecificId creator_id, |
| 96 const String& url, | 100 const String& url, |
| 97 Id transport_node_id) { | 101 Id transport_node_id) { |
| 98 EmbedImpl(creator_id, url, NodeIdFromTransportId(transport_node_id))-> | 102 EmbedImpl(creator_id, url, NodeIdFromTransportId(transport_node_id))-> |
| 99 set_delete_on_connection_error(); | 103 set_delete_on_connection_error(); |
| 100 } | 104 } |
| 101 | 105 |
| 102 ViewManagerServiceImpl* RootNodeManager::GetConnection( | 106 ViewManagerServiceImpl* RootNodeManager::GetConnection( |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } | 295 } |
| 292 | 296 |
| 293 void RootNodeManager::OnViewInputEvent(const View* view, | 297 void RootNodeManager::OnViewInputEvent(const View* view, |
| 294 const ui::Event* event) { | 298 const ui::Event* event) { |
| 295 DispatchViewInputEventToWindowManager(view, event); | 299 DispatchViewInputEventToWindowManager(view, event); |
| 296 } | 300 } |
| 297 | 301 |
| 298 } // namespace service | 302 } // namespace service |
| 299 } // namespace view_manager | 303 } // namespace view_manager |
| 300 } // namespace mojo | 304 } // namespace mojo |
| OLD | NEW |