blob: 91628cf96e522893a5f1e2645dd8e00ab9b2872d [file] [log] [blame]
// Copyright 2018 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/lib/input_reader/tests/mock_device_watcher.h"
#include "src/ui/lib/input_reader/hid_decoder.h"
namespace ui_input {
MockDeviceWatcher::MockDeviceWatcher() : weak_ptr_factory_(this) {}
MockDeviceWatcher::~MockDeviceWatcher() = default;
fxl::WeakPtr<MockDeviceWatcher> MockDeviceWatcher::GetWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
void MockDeviceWatcher::Watch(ExistsCallback callback) { callback_ = std::move(callback); }
void MockDeviceWatcher::AddDevice(std::unique_ptr<HidDecoder> hid_decoder) {
callback_(std::move(hid_decoder));
}
} // namespace ui_input