OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 #ifndef SERVICES_UI_INPUT_MANAGER_INPUT_CONNECTION_IMPL_H_ |
| 6 #define SERVICES_UI_INPUT_MANAGER_INPUT_CONNECTION_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" |
| 10 #include "mojo/public/cpp/bindings/interface_request.h" |
| 11 #include "mojo/services/ui/input/interfaces/input_connection.mojom.h" |
| 12 #include "mojo/services/ui/views/interfaces/views.mojom.h" |
| 13 |
| 14 namespace input_manager { |
| 15 |
| 16 class InputAssociate; |
| 17 |
| 18 // InputConnection implementation. |
| 19 // Binds incoming requests to the relevant view token. |
| 20 class InputConnectionImpl : public mojo::ui::InputConnection { |
| 21 public: |
| 22 InputConnectionImpl( |
| 23 InputAssociate* associate, |
| 24 mojo::ui::ViewTokenPtr view_token, |
| 25 mojo::InterfaceRequest<mojo::ui::InputConnection> request); |
| 26 ~InputConnectionImpl() override; |
| 27 |
| 28 const mojo::ui::ViewToken* view_token() const { return view_token_.get(); } |
| 29 |
| 30 // Delivers an event to a view. |
| 31 void DeliverEvent(mojo::EventPtr event); |
| 32 |
| 33 // |mojo::ui::InputConnection| |
| 34 void SetListener( |
| 35 mojo::InterfaceHandle<mojo::ui::InputListener> listener) override; |
| 36 |
| 37 private: |
| 38 void OnEventFinished(bool handled); |
| 39 |
| 40 InputAssociate* const associate_; |
| 41 mojo::ui::ViewTokenPtr view_token_; |
| 42 mojo::ui::InputListenerPtr listener_; |
| 43 |
| 44 mojo::Binding<mojo::ui::InputConnection> binding_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(InputConnectionImpl); |
| 47 }; |
| 48 |
| 49 } // namespace input_manager |
| 50 |
| 51 #endif // SERVICES_UI_INPUT_MANAGER_INPUT_CONNECTION_IMPL_H_ |
OLD | NEW |