#include "device/gamepad/gamepad_data_fetcher.h"
#include "base/functional/bind.h"
#include "base/no_destructor.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
namespace device {
namespace {
void RunCallbackOnCallbackThread(
mojom::GamepadHapticsManager::PlayVibrationEffectOnceCallback callback,
mojom::GamepadHapticsResult result) { … }
GamepadDataFetcher::HidManagerBinder& GetHidManagerBinder() { … }
}
GamepadDataFetcher::GamepadDataFetcher() = default;
GamepadDataFetcher::~GamepadDataFetcher() = default;
void GamepadDataFetcher::SetHidManagerBinder(HidManagerBinder binder) { … }
void GamepadDataFetcher::InitializeProvider(GamepadPadStateProvider* provider) { … }
void GamepadDataFetcher::BindHidManager(
mojo::PendingReceiver<mojom::HidManager> receiver) { … }
void GamepadDataFetcher::PlayEffect(
int source_id,
mojom::GamepadHapticEffectType type,
mojom::GamepadEffectParametersPtr params,
mojom::GamepadHapticsManager::PlayVibrationEffectOnceCallback callback,
scoped_refptr<base::SequencedTaskRunner> callback_runner) { … }
void GamepadDataFetcher::ResetVibration(
int source_id,
mojom::GamepadHapticsManager::ResetVibrationActuatorCallback callback,
scoped_refptr<base::SequencedTaskRunner> callback_runner) { … }
bool GamepadDataFetcher::DisconnectUnrecognizedGamepad(int source_id) { … }
int64_t GamepadDataFetcher::TimeInMicroseconds(base::TimeTicks update_time) { … }
int64_t GamepadDataFetcher::CurrentTimeInMicroseconds() { … }
void GamepadDataFetcher::UpdateGamepadStrings(const std::string& product_name,
uint16_t vendor_id,
uint16_t product_id,
bool has_standard_mapping,
Gamepad& pad) { … }
void GamepadDataFetcher::RunVibrationCallback(
base::OnceCallback<void(mojom::GamepadHapticsResult)> callback,
scoped_refptr<base::SequencedTaskRunner> callback_runner,
mojom::GamepadHapticsResult result) { … }
GamepadDataFetcherFactory::GamepadDataFetcherFactory() = default;
}