// Copyright 2017 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/events/blink/fling_booster.h" #include "base/trace_event/trace_event.h" WebGestureEvent; WebInputEvent; namespace { // Minimum fling velocity required for the active fling and new fling for the // two to accumulate. const double kMinBoostFlingSpeedSquare = …; // Minimum velocity for the active touch scroll to preserve (boost) an active // fling for which cancellation has been deferred. const double kMinBoostTouchScrollSpeedSquare = …; // Timeout window after which the active fling will be cancelled if no animation // ticks, scrolls or flings of sufficient velocity relative to the current fling // are received. The default value on Android native views is 40ms, but we use a // slightly increased value to accomodate small IPC message delays. constexpr base::TimeDelta kFlingBoostTimeoutDelay = …; } // namespace namespace ui { gfx::Vector2dF FlingBooster::GetVelocityForFlingStart( const blink::WebGestureEvent& fling_start) { … } void FlingBooster::ObserveGestureEvent(const WebGestureEvent& gesture_event) { … } void FlingBooster::ObserveProgressFling( const gfx::Vector2dF& current_velocity) { … } bool FlingBooster::ShouldBoostFling(const WebGestureEvent& fling_start_event) { … } void FlingBooster::Reset() { … } } // namespace ui