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

Side by Side Diff: services/ui/input_manager/input_connection_impl.cc

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 unified diff | Download patch
OLDNEW
(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 #include "services/ui/input_manager/input_connection_impl.h"
6
7 #include "base/bind.h"
8 #include "base/logging.h"
9 #include "services/ui/input_manager/input_associate.h"
10
11 namespace input_manager {
12
13 InputConnectionImpl::InputConnectionImpl(
14 InputAssociate* associate,
15 mojo::ui::ViewTokenPtr view_token,
16 mojo::InterfaceRequest<mojo::ui::InputConnection> request)
17 : associate_(associate),
18 view_token_(view_token.Pass()),
19 binding_(this, request.Pass()) {
20 DCHECK(associate_);
21 DCHECK(view_token_);
22 binding_.set_connection_error_handler(
23 base::Bind(&InputAssociate::OnInputConnectionDied,
24 base::Unretained(associate_), base::Unretained(this)));
25 }
26
27 InputConnectionImpl::~InputConnectionImpl() {}
28
29 void InputConnectionImpl::DeliverEvent(mojo::EventPtr event) {
30 // TODO(jeffbrown): Pass the result back up the stack and handle errors.
31 if (!listener_) {
32 DVLOG(1) << "DeliverEvent: dropped because there was no listener";
33 return;
34 }
35
36 listener_->OnEvent(event.Pass(),
37 base::Bind(&InputConnectionImpl::OnEventFinished,
38 base::Unretained(this)));
39 }
40
41 void InputConnectionImpl::OnEventFinished(bool handled) {
42 // TODO: this code doesn't really belong here
43 }
44
45 void InputConnectionImpl::SetListener(
46 mojo::InterfaceHandle<mojo::ui::InputListener> listener) {
47 listener_ = mojo::ui::InputListenerPtr::Create(std::move(listener));
48 }
49
50 } // namespace input_manager
OLDNEW
« no previous file with comments | « services/ui/input_manager/input_connection_impl.h ('k') | services/ui/input_manager/input_dispatcher_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698