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

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

Issue 338353006: Changes routing of input events in view manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_service_impl.cc
diff --git a/mojo/services/view_manager/view_manager_service_impl.cc b/mojo/services/view_manager/view_manager_service_impl.cc
index f98a9e545129946a2c1f7838c4dc00612d8844fb..d962edadc1e68cbfb50b7dec5b2cc29f0055f44f 100644
--- a/mojo/services/view_manager/view_manager_service_impl.cc
+++ b/mojo/services/view_manager/view_manager_service_impl.cc
@@ -233,15 +233,6 @@ void ViewManagerServiceImpl::ProcessViewDeleted(const ViewId& view,
client()->OnViewDeleted(ViewIdToTransportId(view));
}
-void ViewManagerServiceImpl::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 ViewManagerServiceImpl::OnConnectionError() {
if (delete_on_connection_error_)
delete this;
@@ -753,6 +744,23 @@ void ViewManagerServiceImpl::Embed(const String& url,
callback.Run(success);
}
+void ViewManagerServiceImpl::DispatchOnViewInputEvent(Id transport_view_id,
+ EventPtr event) {
+ // We only allow the WM to dispatch events. At some point this function will
+ // move to a separate interface and the check can go away.
+ if (id_ != kWindowManagerConnection)
+ return;
+
+ const ViewId view_id(ViewIdFromTransportId(transport_view_id));
+ ViewManagerServiceImpl* connection = root_node_manager_->GetConnection(
+ view_id.connection_id);
+ if (connection)
+ connection->client()->OnViewInputEvent(
+ transport_view_id,
+ event.Pass(),
+ base::Bind(&base::DoNothing));
+}
+
void ViewManagerServiceImpl::OnNodeHierarchyChanged(const Node* node,
const Node* new_parent,
const Node* old_parent) {
@@ -767,10 +775,7 @@ void ViewManagerServiceImpl::OnNodeViewReplaced(const Node* node,
void ViewManagerServiceImpl::OnViewInputEvent(const View* view,
const ui::Event* event) {
- ViewManagerServiceImpl* connection = root_node_manager_->GetConnection(
- view->id().connection_id);
- DCHECK(connection);
- connection->ProcessViewInputEvent(view, event);
+ root_node_manager_->DispatchViewInputEventToWindowManager(view, event);
}
void ViewManagerServiceImpl::OnConnectionEstablished() {
« no previous file with comments | « mojo/services/view_manager/view_manager_service_impl.h ('k') | mojo/services/view_manager/view_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698