Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: trunk/src/mojo/services/view_manager/root_node_manager.cc

Issue 405803002: Revert 284322 "Allow EmbedRoot to be called multiple times." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 if (connection_map_.empty()) { 91 CHECK(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);
97 } 93 }
98 94
99 void RootNodeManager::Embed(ConnectionSpecificId creator_id, 95 void RootNodeManager::Embed(ConnectionSpecificId creator_id,
100 const String& url, 96 const String& url,
101 Id transport_node_id) { 97 Id transport_node_id) {
102 EmbedImpl(creator_id, url, NodeIdFromTransportId(transport_node_id))-> 98 EmbedImpl(creator_id, url, NodeIdFromTransportId(transport_node_id))->
103 set_delete_on_connection_error(); 99 set_delete_on_connection_error();
104 } 100 }
105 101
106 ViewManagerServiceImpl* RootNodeManager::GetConnection( 102 ViewManagerServiceImpl* RootNodeManager::GetConnection(
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 } 291 }
296 292
297 void RootNodeManager::OnViewInputEvent(const View* view, 293 void RootNodeManager::OnViewInputEvent(const View* view,
298 const ui::Event* event) { 294 const ui::Event* event) {
299 DispatchViewInputEventToWindowManager(view, event); 295 DispatchViewInputEventToWindowManager(view, event);
300 } 296 }
301 297
302 } // namespace service 298 } // namespace service
303 } // namespace view_manager 299 } // namespace view_manager
304 } // namespace mojo 300 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698