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

Unified Diff: cc/input/single_scrollbar_animation_controller_thinning.h

Issue 2841943002: Overlay scrollbars expand only when mouse is near thumb (Closed)
Patch Set: add tests 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..8d4f482d2d629ff7b1298a2d69162a791caa8871 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,12 @@ 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 captured() const { return captured_; }
bool Animate(base::TimeTicks now);
@@ -46,7 +50,7 @@ class CC_EXPORT SingleScrollbarAnimationControllerThinning {
void DidMouseDown();
void DidMouseUp();
void DidMouseLeave();
- void DidMouseMoveNear(float distance);
+ void DidMouseMove(float distance_to_thumb);
private:
SingleScrollbarAnimationControllerThinning(
@@ -80,8 +84,8 @@ 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_;
// Are we narrowing or thickening the bars.
AnimationChange thickness_change_;

Powered by Google App Engine
This is Rietveld 408576698