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/connection_manager.h" | 5 #include "mojo/services/view_manager/connection_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "mojo/converters/geometry/geometry_type_converters.h" | 9 #include "mojo/converters/geometry/geometry_type_converters.h" |
10 #include "mojo/converters/input_events/input_events_type_converters.h" | 10 #include "mojo/converters/input_events/input_events_type_converters.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 void ConnectionManager::OnWillChangeViewVisibility(const ServerView* view) { | 266 void ConnectionManager::OnWillChangeViewVisibility(const ServerView* view) { |
267 if (in_destructor_) | 267 if (in_destructor_) |
268 return; | 268 return; |
269 | 269 |
270 for (auto& pair : connection_map_) { | 270 for (auto& pair : connection_map_) { |
271 pair.second->service()->ProcessWillChangeViewVisibility( | 271 pair.second->service()->ProcessWillChangeViewVisibility( |
272 view, IsChangeSource(pair.first)); | 272 view, IsChangeSource(pair.first)); |
273 } | 273 } |
274 } | 274 } |
275 | 275 |
276 void ConnectionManager::OnViewPropertyChanged( | 276 void ConnectionManager::OnViewSharedPropertyChanged( |
277 const ServerView* view, | 277 const ServerView* view, |
278 const std::string& name, | 278 const std::string& name, |
279 const std::vector<uint8_t>* new_data) { | 279 const std::vector<uint8_t>* new_data) { |
280 for (auto& pair : connection_map_) { | 280 for (auto& pair : connection_map_) { |
281 pair.second->service()->ProcessViewPropertyChanged( | 281 pair.second->service()->ProcessViewPropertyChanged( |
282 view, name, new_data, IsChangeSource(pair.first)); | 282 view, name, new_data, IsChangeSource(pair.first)); |
283 } | 283 } |
284 } | 284 } |
285 | 285 |
286 void ConnectionManager::SetViewportSize(SizePtr size) { | 286 void ConnectionManager::SetViewportSize(SizePtr size) { |
287 gfx::Size new_size = size.To<gfx::Size>(); | 287 gfx::Size new_size = size.To<gfx::Size>(); |
288 display_manager_->SetViewportSize(new_size); | 288 display_manager_->SetViewportSize(new_size); |
289 } | 289 } |
290 | 290 |
291 void ConnectionManager::DispatchInputEventToView(Id transport_view_id, | 291 void ConnectionManager::DispatchInputEventToView(Id transport_view_id, |
292 EventPtr event) { | 292 EventPtr event) { |
293 const ViewId view_id(ViewIdFromTransportId(transport_view_id)); | 293 const ViewId view_id(ViewIdFromTransportId(transport_view_id)); |
294 | 294 |
295 ViewManagerServiceImpl* connection = GetConnectionWithRoot(view_id); | 295 ViewManagerServiceImpl* connection = GetConnectionWithRoot(view_id); |
296 if (!connection) | 296 if (!connection) |
297 connection = GetConnection(view_id.connection_id); | 297 connection = GetConnection(view_id.connection_id); |
298 if (connection) { | 298 if (connection) { |
299 connection->client()->OnViewInputEvent( | 299 connection->client()->OnViewInputEvent( |
300 transport_view_id, event.Pass(), base::Bind(&base::DoNothing)); | 300 transport_view_id, event.Pass(), base::Bind(&base::DoNothing)); |
301 } | 301 } |
302 } | 302 } |
303 | 303 |
304 } // namespace service | 304 } // namespace service |
305 } // namespace mojo | 305 } // namespace mojo |
OLD | NEW |