| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "mojo/services/view_manager/window_manager_client_impl.h" |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "mojo/services/view_manager/connection_manager.h" |
| 9 #include "mojo/services/view_manager/view_manager_service_impl.h" |
| 10 |
| 11 namespace mojo { |
| 12 namespace service { |
| 13 |
| 14 WindowManagerClientImpl::WindowManagerClientImpl( |
| 15 ConnectionManager* connection_manager) |
| 16 : connection_manager_(connection_manager) { |
| 17 } |
| 18 |
| 19 WindowManagerClientImpl::~WindowManagerClientImpl() { |
| 20 } |
| 21 |
| 22 void WindowManagerClientImpl::DispatchInputEventToView(Id transport_view_id, |
| 23 EventPtr event) { |
| 24 const ViewId view_id(ViewIdFromTransportId(transport_view_id)); |
| 25 |
| 26 ViewManagerServiceImpl* connection = |
| 27 connection_manager_->GetConnectionWithRoot(view_id); |
| 28 if (!connection) |
| 29 connection = connection_manager_->GetConnection(view_id.connection_id); |
| 30 if (connection) { |
| 31 connection->client()->OnViewInputEvent( |
| 32 transport_view_id, event.Pass(), base::Bind(&base::DoNothing)); |
| 33 } |
| 34 } |
| 35 |
| 36 void WindowManagerClientImpl::OnConnectionError() { |
| 37 // TODO(sky): deal with this. We may need to tear everything down here. |
| 38 } |
| 39 |
| 40 } // namespace service |
| 41 } // namespace mojo |
| OLD | NEW |