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/application/service_provider.mojom.h" | 9 #include "mojo/public/interfaces/application/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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 void RootNodeManager::OnConnectionMessagedClient(ConnectionSpecificId id) { | 120 void RootNodeManager::OnConnectionMessagedClient(ConnectionSpecificId id) { |
121 if (current_change_) | 121 if (current_change_) |
122 current_change_->MarkConnectionAsMessaged(id); | 122 current_change_->MarkConnectionAsMessaged(id); |
123 } | 123 } |
124 | 124 |
125 bool RootNodeManager::DidConnectionMessageClient( | 125 bool RootNodeManager::DidConnectionMessageClient( |
126 ConnectionSpecificId id) const { | 126 ConnectionSpecificId id) const { |
127 return current_change_ && current_change_->DidMessageConnection(id); | 127 return current_change_ && current_change_->DidMessageConnection(id); |
128 } | 128 } |
129 | 129 |
130 ViewManagerServiceImpl* RootNodeManager::GetConnectionByCreator( | |
131 ConnectionSpecificId creator_id, | |
132 const std::string& url) const { | |
133 for (ConnectionMap::const_iterator i = connection_map_.begin(); | |
134 i != connection_map_.end(); ++i) { | |
135 if (i->second->creator_id() == creator_id && i->second->url() == url) | |
136 return i->second; | |
137 } | |
138 return NULL; | |
139 } | |
140 | |
141 const ViewManagerServiceImpl* RootNodeManager::GetConnectionWithRoot( | 130 const ViewManagerServiceImpl* RootNodeManager::GetConnectionWithRoot( |
142 const NodeId& id) const { | 131 const NodeId& id) const { |
143 for (ConnectionMap::const_iterator i = connection_map_.begin(); | 132 for (ConnectionMap::const_iterator i = connection_map_.begin(); |
144 i != connection_map_.end(); ++i) { | 133 i != connection_map_.end(); ++i) { |
145 if (i->second->HasRoot(id)) | 134 if (i->second->HasRoot(id)) |
146 return i->second; | 135 return i->second; |
147 } | 136 } |
148 return NULL; | 137 return NULL; |
149 } | 138 } |
150 | 139 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 238 } |
250 | 239 |
251 void RootNodeManager::OnNodeBoundsChanged(const Node* node, | 240 void RootNodeManager::OnNodeBoundsChanged(const Node* node, |
252 const gfx::Rect& old_bounds, | 241 const gfx::Rect& old_bounds, |
253 const gfx::Rect& new_bounds) { | 242 const gfx::Rect& new_bounds) { |
254 ProcessNodeBoundsChanged(node, old_bounds, new_bounds); | 243 ProcessNodeBoundsChanged(node, old_bounds, new_bounds); |
255 } | 244 } |
256 | 245 |
257 } // namespace service | 246 } // namespace service |
258 } // namespace mojo | 247 } // namespace mojo |
OLD | NEW |