// Copyright 2018 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CC_INPUT_SNAP_FLING_CONTROLLER_H_ #define CC_INPUT_SNAP_FLING_CONTROLLER_H_ #include <memory> #include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "cc/cc_export.h" #include "ui/gfx/geometry/point_f.h" #include "ui/gfx/geometry/vector2d_f.h" namespace cc { namespace test { class SnapFlingControllerTest; } class SnapFlingCurve; // A client that provides information to the controller. It also executes the // scroll operations and requests animation frames. All the inputs and outputs // are in the same coordinate space. class SnapFlingClient { … }; // SnapFlingController ensures that an incoming fling event (or inertial-phase // scroll event) would land on a snap position if there is a valid one nearby. // It takes an input event, filters it if it conflicts with the current fling, // or generates a curve if the SnapFlingClient finds a valid snap position. // It also animates the curve by notifying the client to scroll when clock // ticks. class CC_EXPORT SnapFlingController { … }; } // namespace cc #endif // CC_INPUT_SNAP_FLING_CONTROLLER_H_