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

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

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: wip: address high-level comments Created 3 years, 9 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: ui/views/animation/ink_drop_host_view.h
diff --git a/ui/views/animation/ink_drop_host_view.h b/ui/views/animation/ink_drop_host_view.h
index 1b6843aabfb6d9955f5e9dbf639e7a3428f98c6b..916cab31d9d794d4e7a0bd160165468497cd14c9 100644
--- a/ui/views/animation/ink_drop_host_view.h
+++ b/ui/views/animation/ink_drop_host_view.h
@@ -58,6 +58,15 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost {
}
float ink_drop_visible_opacity() const { return ink_drop_visible_opacity_; }
+ // Animates |ink_drop_| to the desired |ink_drop_state|. Caches |event| as the
+ // last_ripple_triggering_event().
+ //
+ // *** NOTE ***: |event| has been plumbed through on a best effort basis for
+ // the purposes of centering ink drop ripples on located Events. Thus nullptr
+ // has been used by clients who do not have an Event instance available to
+ // them.
+ void AnimateInkDrop(InkDropState state, const ui::LocatedEvent* event);
+
protected:
static constexpr int kInkDropSmallCornerRadius = 2;
static constexpr int kInkDropLargeCornerRadius = 4;
@@ -71,29 +80,16 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost {
// Returns the default InkDropRipple centered on |center_point|.
std::unique_ptr<InkDropRipple> CreateDefaultInkDropRipple(
- const gfx::Point& center_point,
- const gfx::Size& size = gfx::Size(kDefaultInkDropSize,
- kDefaultInkDropSize)) const;
+ const gfx::Point& center_point) const;
// Returns the default InkDropHighlight centered on |center_point|.
std::unique_ptr<InkDropHighlight> CreateDefaultInkDropHighlight(
- const gfx::PointF& center_point,
- const gfx::Size& size = gfx::Size(kDefaultInkDropSize,
- kDefaultInkDropSize)) const;
+ const gfx::PointF& center_point) const;
// Returns the point of the |last_ripple_triggering_event_| if it was a
// LocatedEvent, otherwise the center point of the local bounds is returned.
gfx::Point GetInkDropCenterBasedOnLastEvent() const;
- // Animates |ink_drop_| to the desired |ink_drop_state|. Caches |event| as the
- // last_ripple_triggering_event().
- //
- // *** NOTE ***: |event| has been plumbed through on a best effort basis for
- // the purposes of centering ink drop ripples on located Events. Thus nullptr
- // has been used by clients who do not have an Event instance available to
- // them.
- void AnimateInkDrop(InkDropState state, const ui::LocatedEvent* event);
-
// View:
void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
void VisibilityChanged(View* starting_from, bool is_visible) override;
@@ -122,6 +118,8 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost {
// of CreateInkDrop() delegates to this function.
std::unique_ptr<InkDropImpl> CreateDefaultInkDropImpl();
+ gfx::Size GetInkDropSize() const;
+
private:
class InkDropGestureHandler;
friend class InkDropGestureHandler;

Powered by Google App Engine
This is Rietveld 408576698