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

Unified Diff: ui/views/animation/ink_drop_impl.h

Issue 2001843002: Use ink drop hover for focus states on toolbar buttons and location (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout Created 4 years, 7 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
« no previous file with comments | « ui/views/animation/ink_drop_host_view.cc ('k') | ui/views/animation/ink_drop_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_impl.h
diff --git a/ui/views/animation/ink_drop_impl.h b/ui/views/animation/ink_drop_impl.h
index dec07a9a981a7842592a5744c11303ded5803c64..e9b2640f363a320b2bfdf8b7212e448fd8d79e65 100644
--- a/ui/views/animation/ink_drop_impl.h
+++ b/ui/views/animation/ink_drop_impl.h
@@ -45,6 +45,7 @@ class VIEWS_EXPORT InkDropImpl : public InkDrop,
void AnimateToState(InkDropState ink_drop_state) override;
void SnapToActivated() override;
void SetHovered(bool is_hovered) override;
+ void SetFocused(bool is_focused) override;
private:
friend class test::InkDropImplTestApi;
@@ -89,13 +90,16 @@ class VIEWS_EXPORT InkDropImpl : public InkDrop,
void AnimationEnded(InkDropHover::AnimationType animation_type,
InkDropAnimationEndedReason reason) override;
- // Enables or disables the hover state based on |is_hovered| and if an
+ // Enables or disables the hover state based on |should_highlight| and if an
// animation is triggered it will be scheduled to have the given
// |animation_duration|. If |explode| is true the hover will expand as it
- // fades out. |explode| is ignored when |is_hovered| is true.
- void SetHoveredInternal(bool is_hovered,
- base::TimeDelta animation_duration,
- bool explode);
+ // fades out. |explode| is ignored when |should_higlight| is true.
+ void SetHighlight(bool should_highlight,
+ base::TimeDelta animation_duration,
+ bool explode);
+
+ // Returns true if this ink drop is hovered or focused.
+ bool ShouldHighlight() const;
// Starts the |hover_after_ripple_timer_| timer. This will stop the current
// |hover_after_ripple_timer_| instance if it exists.
@@ -126,6 +130,10 @@ class VIEWS_EXPORT InkDropImpl : public InkDrop,
// SetHovered() function.
bool is_hovered_;
+ // Tracks the logical focused state of |this| as manipulated by the public
+ // SetFocused() function.
+ bool is_focused_;
+
// The current InkDropRipple. Created on demand using CreateInkDropRipple().
std::unique_ptr<InkDropRipple> ink_drop_ripple_;
« no previous file with comments | « ui/views/animation/ink_drop_host_view.cc ('k') | ui/views/animation/ink_drop_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698