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

Unified Diff: mojo/services/view_manager/view_manager_connection.cc

Issue 316713002: Wire input events through the ViewManagerClient interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android Created 6 years, 6 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
Index: mojo/services/view_manager/view_manager_connection.cc
diff --git a/mojo/services/view_manager/view_manager_connection.cc b/mojo/services/view_manager/view_manager_connection.cc
index 08831baa99914c82e9b335db2ac81b670d9147a1..52a39044e8c9004c4fff02bd391df0ccd75625b4 100644
--- a/mojo/services/view_manager/view_manager_connection.cc
+++ b/mojo/services/view_manager/view_manager_connection.cc
@@ -4,8 +4,10 @@
#include "mojo/services/view_manager/view_manager_connection.h"
+#include "base/bind.h"
#include "base/stl_util.h"
#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
+#include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
#include "mojo/services/view_manager/node.h"
#include "mojo/services/view_manager/root_node_manager.h"
#include "mojo/services/view_manager/view.h"
@@ -202,6 +204,15 @@ void ViewManagerConnection::ProcessViewDeleted(const ViewId& view,
client()->OnViewDeleted(ViewIdToTransportId(view));
}
+void ViewManagerConnection::ProcessViewInputEvent(const View* view,
+ const ui::Event* event) {
+ DCHECK_EQ(id_, view->id().connection_id);
+ client()->OnViewInputEvent(
+ ViewIdToTransportId(view->id()),
+ TypeConverter<EventPtr, ui::Event>::ConvertFrom(*event),
+ base::Bind(&base::DoNothing));
+}
+
void ViewManagerConnection::OnConnectionError() {
if (delete_on_connection_error_)
delete this;
@@ -618,6 +629,14 @@ void ViewManagerConnection::OnNodeViewReplaced(const Node* node,
root_node_manager_->ProcessNodeViewReplaced(node, new_view, old_view);
}
+void ViewManagerConnection::OnViewInputEvent(const View* view,
+ const ui::Event* event) {
+ ViewManagerConnection* connection = root_node_manager_->GetConnection(
+ view->id().connection_id);
+ DCHECK(connection);
+ connection->ProcessViewInputEvent(view, event);
+}
+
void ViewManagerConnection::OnConnectionEstablished() {
root_node_manager_->AddConnection(this);
« no previous file with comments | « mojo/services/view_manager/view_manager_connection.h ('k') | mojo/services/view_manager/view_manager_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698