blob: bdb19b6d7b7388a1b60a523316f081dd47d18bb5 [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/ui/scenic/lib/input/mouse_source.h"
#include "src/lib/fsl/handles/object_info.h"
namespace scenic_impl::input {
MouseSource::MouseSource(fidl::InterfaceRequest<fuchsia::ui::pointer::MouseSource> mouse_source,
fit::function<void()> error_handler)
: MouseSourceBase(fsl::GetKoid(mouse_source.channel().get()), /*close_channel=*/
[this](zx_status_t epitaph) {
binding_.Close(epitaph);
error_handler_();
}),
binding_(this, std::move(mouse_source)),
error_handler_(std::move(error_handler)) {
binding_.set_error_handler([this](zx_status_t) { error_handler_(); });
}
} // namespace scenic_impl::input