#include "ui/events/gestures/gesture_recognizer_impl.h"
#include <stddef.h>
#include <limits>
#include <memory>
#include "base/check.h"
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_switches.h"
#include "ui/events/event_utils.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
#include "ui/events/gestures/gesture_provider_aura.h"
#include "ui/events/gestures/gesture_types.h"
#include "ui/events/types/event_type.h"
namespace ui {
namespace {
void TransferConsumer(
GestureConsumer* current_consumer,
GestureConsumer* new_consumer,
std::set<raw_ptr<GestureConsumer, SetExperimental>>& consumers) { … }
template <class Key, class T, class Value>
bool RemoveValueFromMap(std::map<Key, T>* map, const Value& value) { … }
}
GestureRecognizerImpl::GestureRecognizerImpl() = default;
GestureRecognizerImpl::~GestureRecognizerImpl() { … }
GestureConsumer* GestureRecognizerImpl::GetTouchLockedTarget(
const TouchEvent& event) { … }
GestureConsumer* GestureRecognizerImpl::GetTargetForLocation(
const gfx::PointF& location,
int source_device_id) { … }
void GestureRecognizerImpl::CancelActiveTouchesExcept(
GestureConsumer* not_cancelled) { … }
void GestureRecognizerImpl::CancelActiveTouchesOn(
const std::vector<GestureConsumer*>& consumers) { … }
void GestureRecognizerImpl::TransferEventsTo(
GestureConsumer* current_consumer,
GestureConsumer* new_consumer,
TransferTouchesBehavior transfer_touches_behavior) { … }
bool GestureRecognizerImpl::GetLastTouchPointForTarget(
GestureConsumer* consumer,
gfx::PointF* point) { … }
std::vector<std::unique_ptr<TouchEvent>>
GestureRecognizerImpl::GetEventPerPointForConsumer(GestureConsumer* consumer,
EventType type) { … }
bool GestureRecognizerImpl::CancelActiveTouches(GestureConsumer* consumer) { … }
GestureProviderAura* GestureRecognizerImpl::GetGestureProviderForConsumer(
GestureConsumer* consumer) { … }
bool GestureRecognizerImpl::ProcessTouchEventPreDispatch(
TouchEvent* event,
GestureConsumer* consumer) { … }
void GestureRecognizerImpl::SetupTargets(const TouchEvent& event,
GestureConsumer* target) { … }
void GestureRecognizerImpl::DispatchGestureEvent(
GestureConsumer* raw_input_consumer,
GestureEvent* event) { … }
GestureRecognizer::Gestures GestureRecognizerImpl::AckTouchEvent(
uint32_t unique_event_id,
ui::EventResult result,
bool is_source_touch_event_set_blocking,
GestureConsumer* consumer) { … }
void GestureRecognizerImpl::CancelActiveTouchesExceptImpl(
GestureConsumer* not_cancelled) { … }
bool GestureRecognizerImpl::CancelActiveTouchesImpl(GestureConsumer* consumer) { … }
bool GestureRecognizerImpl::CleanupStateForConsumer(GestureConsumer* consumer) { … }
void GestureRecognizerImpl::AddGestureEventHelper(GestureEventHelper* helper) { … }
void GestureRecognizerImpl::RemoveGestureEventHelper(
GestureEventHelper* helper) { … }
bool GestureRecognizerImpl::DoesConsumerHaveActiveTouch(
GestureConsumer* consumer) const { … }
void GestureRecognizerImpl::SendSynthesizedEndEvents(
GestureConsumer* consumer) { … }
void GestureRecognizerImpl::OnGestureEvent(GestureConsumer* raw_input_consumer,
GestureEvent* event) { … }
void GestureRecognizerImpl::OnGestureProviderAuraWillBeDestroyed(
GestureProviderAura* gesture_provider) { … }
GestureEventHelper* GestureRecognizerImpl::FindDispatchHelperForConsumer(
GestureConsumer* consumer) { … }
}