OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "services/ui/input_manager/input_associate.h" | 5 #include "services/ui/input_manager/input_associate.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 callback.Run(info.Pass()); | 42 callback.Run(info.Pass()); |
43 } | 43 } |
44 | 44 |
45 void InputAssociate::ConnectToViewService( | 45 void InputAssociate::ConnectToViewService( |
46 mojo::ui::ViewTokenPtr view_token, | 46 mojo::ui::ViewTokenPtr view_token, |
47 const mojo::String& service_name, | 47 const mojo::String& service_name, |
48 mojo::ScopedMessagePipeHandle client_handle) { | 48 mojo::ScopedMessagePipeHandle client_handle) { |
49 DCHECK(view_token); // checked by mojom | 49 DCHECK(view_token); // checked by mojom |
50 | 50 |
51 if (service_name == mojo::ui::InputConnection::Name_) { | 51 if (service_name == mojo::ui::InputConnection::Name_) { |
52 CreateInputConnection( | 52 CreateInputConnection(view_token.Pass(), |
53 view_token.Pass(), | 53 mojo::InterfaceRequest<mojo::ui::InputConnection>( |
54 mojo::MakeRequest<mojo::ui::InputConnection>(client_handle.Pass())); | 54 client_handle.Pass())); |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 void InputAssociate::ConnectToViewTreeService( | 58 void InputAssociate::ConnectToViewTreeService( |
59 mojo::ui::ViewTreeTokenPtr view_tree_token, | 59 mojo::ui::ViewTreeTokenPtr view_tree_token, |
60 const mojo::String& service_name, | 60 const mojo::String& service_name, |
61 mojo::ScopedMessagePipeHandle client_handle) { | 61 mojo::ScopedMessagePipeHandle client_handle) { |
62 DCHECK(view_tree_token); // checked by mojom | 62 DCHECK(view_tree_token); // checked by mojom |
63 | 63 |
64 if (service_name == mojo::ui::InputDispatcher::Name_) { | 64 if (service_name == mojo::ui::InputDispatcher::Name_) { |
65 CreateInputDispatcher( | 65 CreateInputDispatcher(view_tree_token.Pass(), |
66 view_tree_token.Pass(), | 66 mojo::InterfaceRequest<mojo::ui::InputDispatcher>( |
67 mojo::MakeRequest<mojo::ui::InputDispatcher>(client_handle.Pass())); | 67 client_handle.Pass())); |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 void InputAssociate::CreateInputConnection( | 71 void InputAssociate::CreateInputConnection( |
72 mojo::ui::ViewTokenPtr view_token, | 72 mojo::ui::ViewTokenPtr view_token, |
73 mojo::InterfaceRequest<mojo::ui::InputConnection> request) { | 73 mojo::InterfaceRequest<mojo::ui::InputConnection> request) { |
74 DCHECK(view_token); | 74 DCHECK(view_token); |
75 DCHECK(request.is_pending()); | 75 DCHECK(request.is_pending()); |
76 DVLOG(1) << "CreateInputConnection: view_token=" << view_token; | 76 DVLOG(1) << "CreateInputConnection: view_token=" << view_token; |
77 | 77 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 auto it = input_connections_by_view_token_.find(view_token->value); | 130 auto it = input_connections_by_view_token_.find(view_token->value); |
131 if (it == input_connections_by_view_token_.end()) { | 131 if (it == input_connections_by_view_token_.end()) { |
132 DVLOG(1) << "DeliverEvent: dropped because there was no input connection"; | 132 DVLOG(1) << "DeliverEvent: dropped because there was no input connection"; |
133 return; | 133 return; |
134 } | 134 } |
135 | 135 |
136 it->second->DeliverEvent(event.Pass()); | 136 it->second->DeliverEvent(event.Pass()); |
137 } | 137 } |
138 | 138 |
139 } // namespace input_manager | 139 } // namespace input_manager |
OLD | NEW |