chromium/ui/events/mobile_scroller.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/mobile_scroller.h"

#include <cmath>
#include <ostream>

#include "base/check_op.h"
#include "base/lazy_instance.h"
#include "base/notreached.h"
#include "base/numerics/math_constants.h"

namespace ui {
namespace {

// Default scroll duration from android.widget.Scroller.
const int kDefaultDurationMs =;

// Default friction constant in android.view.ViewConfiguration.
const float kDefaultFriction =;

// == std::log(0.78f) / std::log(0.9f)
const float kDecelerationRate =;

// Tension lines cross at (kInflexion, 1).
const float kInflexion =;

const float kEpsilon =;

// Fling scroll is stopped when the scroll position is |kThresholdForFlingEnd|
// pixels or closer from the end.
const float kThresholdForFlingEnd =;

bool ApproxEquals(float a, float b) {}

struct ViscosityConstants {};

struct SplineConstants {};

float ComputeDeceleration(float friction) {}

template <typename T>
int Signum(T t) {}

template <typename T>
T Clamped(T t, T a, T b) {}

// Leaky to allow access from the impl thread.
base::LazyInstance<ViscosityConstants>::Leaky g_viscosity_constants =;

base::LazyInstance<SplineConstants>::Leaky g_spline_constants =;

}  // namespace

MobileScroller::Config::Config()
    :{}

MobileScroller::MobileScroller(const Config& config)
    :{}

MobileScroller::~MobileScroller() {}

bool MobileScroller::ComputeScrollOffset(base::TimeTicks time,
                                         gfx::Vector2dF* offset,
                                         gfx::Vector2dF* velocity) {}

void MobileScroller::StartScroll(float start_x,
                                 float start_y,
                                 float dx,
                                 float dy,
                                 base::TimeTicks start_time) {}

void MobileScroller::StartScroll(float start_x,
                                 float start_y,
                                 float dx,
                                 float dy,
                                 base::TimeTicks start_time,
                                 base::TimeDelta duration) {}

void MobileScroller::Fling(float start_x,
                           float start_y,
                           float velocity_x,
                           float velocity_y,
                           float min_x,
                           float max_x,
                           float min_y,
                           float max_y,
                           base::TimeTicks start_time) {}

void MobileScroller::ExtendDuration(base::TimeDelta extend) {}

void MobileScroller::SetFinalX(float new_x) {}

void MobileScroller::SetFinalY(float new_y) {}

void MobileScroller::AbortAnimation() {}

void MobileScroller::ForceFinished(bool finished) {}

bool MobileScroller::IsFinished() const {}

base::TimeDelta MobileScroller::GetTimePassed() const {}

base::TimeDelta MobileScroller::GetDuration() const {}

float MobileScroller::GetCurrX() const {}

float MobileScroller::GetCurrY() const {}

float MobileScroller::GetCurrVelocity() const {}

float MobileScroller::GetCurrVelocityX() const {}

float MobileScroller::GetCurrVelocityY() const {}

float MobileScroller::GetStartX() const {}

float MobileScroller::GetStartY() const {}

float MobileScroller::GetFinalX() const {}

float MobileScroller::GetFinalY() const {}

bool MobileScroller::IsScrollingInDirection(float xvel, float yvel) const {}

bool MobileScroller::ComputeScrollOffsetInternal(base::TimeTicks time) {}

void MobileScroller::RecomputeDeltas() {}

double MobileScroller::GetSplineDeceleration(float velocity) const {}

base::TimeDelta MobileScroller::GetSplineFlingDuration(float velocity) const {}

double MobileScroller::GetSplineFlingDistance(float velocity) const {}

}  // namespace ui