#include "cc/input/single_scrollbar_animation_controller_thinning.h"
#include <algorithm>
#include "base/memory/ptr_util.h"
#include "base/time/time.h"
#include "cc/input/scrollbar_animation_controller.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/scrollbar_layer_impl_base.h"
#include "cc/trees/layer_tree_impl.h"
namespace cc {
namespace {
float DistanceToRect(const gfx::PointF& device_viewport_point,
const ScrollbarLayerImplBase& scrollbar,
const gfx::Rect& rect) { … }
float DistanceToScrollbar(const gfx::PointF& device_viewport_point,
const ScrollbarLayerImplBase& scrollbar) { … }
float DistanceToScrollbarThumb(const gfx::PointF& device_viewport_point,
const ScrollbarLayerImplBase& scrollbar) { … }
}
std::unique_ptr<SingleScrollbarAnimationControllerThinning>
SingleScrollbarAnimationControllerThinning::Create(
ElementId scroll_element_id,
ScrollbarOrientation orientation,
ScrollbarAnimationControllerClient* client,
base::TimeDelta thinning_duration,
float idle_thickness_scale) { … }
SingleScrollbarAnimationControllerThinning::
SingleScrollbarAnimationControllerThinning(
ElementId scroll_element_id,
ScrollbarOrientation orientation,
ScrollbarAnimationControllerClient* client,
base::TimeDelta thinning_duration,
float idle_thickness_scale)
: … { … }
ScrollbarLayerImplBase*
SingleScrollbarAnimationControllerThinning::GetScrollbar() const { … }
bool SingleScrollbarAnimationControllerThinning::Animate(base::TimeTicks now) { … }
float SingleScrollbarAnimationControllerThinning::AnimationProgressAtTime(
base::TimeTicks now) { … }
void SingleScrollbarAnimationControllerThinning::RunAnimationFrame(
float progress) { … }
void SingleScrollbarAnimationControllerThinning::StartAnimation() { … }
void SingleScrollbarAnimationControllerThinning::StopAnimation() { … }
void SingleScrollbarAnimationControllerThinning::DidScrollUpdate() { … }
void SingleScrollbarAnimationControllerThinning::DidMouseDown() { … }
void SingleScrollbarAnimationControllerThinning::DidMouseUp() { … }
void SingleScrollbarAnimationControllerThinning::DidMouseLeave() { … }
void SingleScrollbarAnimationControllerThinning::DidMouseMove(
const gfx::PointF& device_viewport_point) { … }
void SingleScrollbarAnimationControllerThinning::CalculateThicknessShouldChange(
const gfx::PointF& device_viewport_point) { … }
float SingleScrollbarAnimationControllerThinning::ThumbThicknessScaleAt(
float progress) const { … }
float SingleScrollbarAnimationControllerThinning::AdjustScale(
float new_value,
float current_value,
AnimationChange animation_change,
float min_value,
float max_value) { … }
float SingleScrollbarAnimationControllerThinning::
CurrentForcedThumbThicknessScale() const { … }
void SingleScrollbarAnimationControllerThinning::UpdateThumbThicknessScale() { … }
void SingleScrollbarAnimationControllerThinning::DidRequestShow() { … }
void SingleScrollbarAnimationControllerThinning::ApplyThumbThicknessScale(
float thumb_thickness_scale) { … }
void SingleScrollbarAnimationControllerThinning::UpdateTickmarksVisibility(
bool show) { … }
float SingleScrollbarAnimationControllerThinning::
MouseMoveDistanceToTriggerExpand() { … }
float SingleScrollbarAnimationControllerThinning::
MouseMoveDistanceToTriggerFadeIn() { … }
}