#include "third_party/blink/renderer/platform/widget/input/elastic_overscroll_controller.h"
#include <math.h>
#include <algorithm>
#include "base/functional/bind.h"
#include "build/build_config.h"
#include "cc/input/input_handler.h"
#include "third_party/blink/renderer/platform/widget/input/elastic_overscroll_controller_bezier.h"
#include "third_party/blink/renderer/platform/widget/input/elastic_overscroll_controller_exponential.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/types/scroll_types.h"
#include "ui/gfx/geometry/vector2d_conversions.h"
namespace blink {
namespace {
constexpr double kScrollVelocityZeroingTimeout = …;
constexpr double kRubberbandMinimumRequiredDeltaBeforeStretch = …;
#if BUILDFLAG(IS_ANDROID)
constexpr bool kOverscrollNonScrollableDirection = false;
#else
constexpr bool kOverscrollNonScrollableDirection = …;
#endif
}
ElasticOverscrollController::ElasticOverscrollController(
cc::ScrollElasticityHelper* helper)
: … { … }
std::unique_ptr<ElasticOverscrollController>
ElasticOverscrollController::Create(cc::ScrollElasticityHelper* helper) { … }
void ElasticOverscrollController::ObserveRealScrollBegin(bool enter_momentum,
bool leave_momentum) { … }
void ElasticOverscrollController::ObserveScrollUpdate(
const gfx::Vector2dF& event_delta,
const gfx::Vector2dF& unused_scroll_delta,
const base::TimeTicks& event_timestamp,
const cc::OverscrollBehavior overscroll_behavior,
bool has_momentum) { … }
void ElasticOverscrollController::ObserveRealScrollEnd(
const base::TimeTicks event_timestamp) { … }
void ElasticOverscrollController::ObserveGestureEventAndResult(
const WebGestureEvent& gesture_event,
const cc::InputHandlerScrollResult& scroll_result) { … }
void ElasticOverscrollController::UpdateVelocity(
const gfx::Vector2dF& event_delta,
const base::TimeTicks& event_timestamp) { … }
void ElasticOverscrollController::Overscroll(
const gfx::Vector2dF& overscroll_delta) { … }
void ElasticOverscrollController::EnterStateInactive() { … }
void ElasticOverscrollController::EnterStateMomentumAnimated(
const base::TimeTicks& triggering_event_timestamp) { … }
void ElasticOverscrollController::Animate(base::TimeTicks time) { … }
bool ElasticOverscrollController::PinnedHorizontally(float direction) const { … }
bool ElasticOverscrollController::PinnedVertically(float direction) const { … }
bool ElasticOverscrollController::CanScrollHorizontally() const { … }
bool ElasticOverscrollController::CanScrollVertically() const { … }
void ElasticOverscrollController::ReconcileStretchAndScroll() { … }
}