Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: services/ui/input_manager/input_connection_impl.h

Issue 1776473005: Mozart: Implement basic input event dispatch with hit testing. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-7
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/input_manager/input_associate.cc ('k') | services/ui/input_manager/input_connection_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/input_manager/input_connection_impl.h
diff --git a/services/ui/input_manager/input_connection_impl.h b/services/ui/input_manager/input_connection_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..492fb87cfe786177b8a5854ffe3d2eca05b1c553
--- /dev/null
+++ b/services/ui/input_manager/input_connection_impl.h
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_UI_INPUT_MANAGER_INPUT_CONNECTION_IMPL_H_
+#define SERVICES_UI_INPUT_MANAGER_INPUT_CONNECTION_IMPL_H_
+
+#include "base/macros.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+#include "mojo/services/ui/input/interfaces/input_connection.mojom.h"
+#include "mojo/services/ui/views/interfaces/views.mojom.h"
+
+namespace input_manager {
+
+class InputAssociate;
+
+// InputConnection implementation.
+// Binds incoming requests to the relevant view token.
+class InputConnectionImpl : public mojo::ui::InputConnection {
+ public:
+ InputConnectionImpl(
+ InputAssociate* associate,
+ mojo::ui::ViewTokenPtr view_token,
+ mojo::InterfaceRequest<mojo::ui::InputConnection> request);
+ ~InputConnectionImpl() override;
+
+ const mojo::ui::ViewToken* view_token() const { return view_token_.get(); }
+
+ // Delivers an event to a view.
+ void DeliverEvent(mojo::EventPtr event);
+
+ // |mojo::ui::InputConnection|
+ void SetListener(
+ mojo::InterfaceHandle<mojo::ui::InputListener> listener) override;
+
+ private:
+ void OnEventFinished(bool handled);
+
+ InputAssociate* const associate_;
+ mojo::ui::ViewTokenPtr view_token_;
+ mojo::ui::InputListenerPtr listener_;
+
+ mojo::Binding<mojo::ui::InputConnection> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(InputConnectionImpl);
+};
+
+} // namespace input_manager
+
+#endif // SERVICES_UI_INPUT_MANAGER_INPUT_CONNECTION_IMPL_H_
« no previous file with comments | « services/ui/input_manager/input_associate.cc ('k') | services/ui/input_manager/input_connection_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698