Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3189)

Unified Diff: cc/input/single_scrollbar_animation_controller_thinning.h

Issue 2841943002: Overlay scrollbars expand only when mouse is near thumb (Closed)
Patch Set: bokan comments#8 addressed Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/input/single_scrollbar_animation_controller_thinning.h
diff --git a/cc/input/single_scrollbar_animation_controller_thinning.h b/cc/input/single_scrollbar_animation_controller_thinning.h
index f07806c39f29eca5f3e130aff5aadba99f10bcc4..20c06835b3efe6ab10917763e12acf914aee7691 100644
--- a/cc/input/single_scrollbar_animation_controller_thinning.h
+++ b/cc/input/single_scrollbar_animation_controller_thinning.h
@@ -23,7 +23,7 @@ class ScrollbarAnimationControllerClient;
class CC_EXPORT SingleScrollbarAnimationControllerThinning {
public:
static constexpr float kIdleThicknessScale = 0.4f;
- static constexpr float kDefaultMouseMoveDistanceToTriggerAnimation = 25.f;
+ static constexpr float kMouseMoveDistanceToTriggerExpand = 25.f;
static std::unique_ptr<SingleScrollbarAnimationControllerThinning> Create(
ElementId scroll_element_id,
@@ -33,8 +33,16 @@ class CC_EXPORT SingleScrollbarAnimationControllerThinning {
~SingleScrollbarAnimationControllerThinning() {}
- bool mouse_is_over_scrollbar() const { return mouse_is_over_scrollbar_; }
- bool mouse_is_near_scrollbar() const { return mouse_is_near_scrollbar_; }
+ bool mouse_is_over_scrollbar_thumb() const {
+ return mouse_is_over_scrollbar_thumb_;
+ }
+ bool mouse_is_near_scrollbar_thumb() const {
+ return mouse_is_near_scrollbar_thumb_;
+ }
+ bool mouse_is_near_scrollbar_track() const {
+ return mouse_is_near_scrollbar_track_;
+ }
+
bool captured() const { return captured_; }
bool Animate(base::TimeTicks now);
@@ -46,7 +54,7 @@ class CC_EXPORT SingleScrollbarAnimationControllerThinning {
void DidMouseDown();
void DidMouseUp();
void DidMouseLeave();
- void DidMouseMoveNear(float distance);
+ void DidMouseMove(const gfx::PointF& device_viewport_point);
private:
SingleScrollbarAnimationControllerThinning(
@@ -55,6 +63,7 @@ class CC_EXPORT SingleScrollbarAnimationControllerThinning {
ScrollbarAnimationControllerClient* client,
base::TimeDelta thinning_duration);
+ ScrollbarLayerImplBase* GetScrollbar() const;
float AnimationProgressAtTime(base::TimeTicks now);
void RunAnimationFrame(float progress);
const base::TimeDelta& Duration();
@@ -80,8 +89,9 @@ class CC_EXPORT SingleScrollbarAnimationControllerThinning {
ScrollbarOrientation orientation_;
bool captured_;
- bool mouse_is_over_scrollbar_;
- bool mouse_is_near_scrollbar_;
+ bool mouse_is_over_scrollbar_thumb_;
+ bool mouse_is_near_scrollbar_thumb_;
+ bool mouse_is_near_scrollbar_track_;
// Are we narrowing or thickening the bars.
AnimationChange thickness_change_;

Powered by Google App Engine
This is Rietveld 408576698