chromium/ui/events/gesture_detection/gesture_detector.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "ui/events/gesture_detection/gesture_detector.h"

#include <stddef.h>

#include <algorithm>
#include <cmath>

#include "base/memory/raw_ptr.h"
#include "base/numerics/angle_conversions.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/event_constants.h"
#include "ui/events/gesture_detection/gesture_listeners.h"
#include "ui/events/velocity_tracker/motion_event.h"

namespace ui {
namespace {

// Minimum distance a scroll must have traveled from the last scroll/focal point
// to trigger an |OnScroll| callback.
const float kScrollEpsilon =;

// Constants used by TimeoutGestureHandler.
enum TimeoutEvent {};

}  // namespace

GestureDetector::Config::Config() = default;
GestureDetector::Config::Config(const Config& other) = default;
GestureDetector::Config::~Config() = default;

class GestureDetector::TimeoutGestureHandler {};

GestureDetector::GestureDetector(
    const Config& config,
    GestureListener* listener,
    DoubleTapListener* optional_double_tap_listener)
    :{}

GestureDetector::~GestureDetector() = default;

bool GestureDetector::OnTouchEvent(const MotionEvent& ev,
                                   bool should_process_double_tap) {}

void GestureDetector::SetDoubleTapListener(
    DoubleTapListener* double_tap_listener) {}

void GestureDetector::Init(const Config& config) {}

void GestureDetector::OnShowPressTimeout() {}

void GestureDetector::OnShortPressTimeout() {}

void GestureDetector::OnLongPressTimeout() {}

void GestureDetector::OnTapTimeout() {}

void GestureDetector::ActivateShortPressGesture(const MotionEvent& ev) {}

void GestureDetector::ActivateLongPressGesture(const MotionEvent& ev) {}

void GestureDetector::Cancel() {}

void GestureDetector::CancelTaps() {}

bool GestureDetector::IsRepeatedTap(const MotionEvent& first_down,
                                    const MotionEvent& first_up,
                                    const MotionEvent& second_down,
                                    bool should_process_double_tap) const {}

bool GestureDetector::HandleSwipeIfNeeded(const MotionEvent& up,
                                          float vx,
                                          float vy) {}

bool GestureDetector::IsWithinSlopForTap(const MotionEvent& ev) {}

const MotionEvent* GestureDetector::GetSourcePointerDownEvent(
    const MotionEvent& current_down_event,
    const MotionEvent* secondary_pointer_down_event,
    const int pointer_id) {}

}  // namespace ui