Chromium Code Reviews| 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 2f30b24b3b7e5eb6df158dcd839f7f634ede875e..10057932638b2daf2fff9ba06030148bf6d14692 100644 |
| --- a/ui/views/animation/ink_drop_host_view.h |
| +++ b/ui/views/animation/ink_drop_host_view.h |
| @@ -22,6 +22,7 @@ class InkDropHostViewTestApi; |
| class InkDropRipple; |
| class InkDropHighlight; |
| +class InkDropImpl; |
| // A view that provides InkDropHost functionality. |
| class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost { |
| @@ -32,11 +33,10 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost { |
| // Overridden from InkDropHost: |
| void AddInkDropLayer(ui::Layer* ink_drop_layer) override; |
| void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; |
| + std::unique_ptr<InkDrop> CreateInkDrop() override; |
| std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override; |
| std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override; |
| - void set_ink_drop_size(const gfx::Size& size) { ink_drop_size_ = size; } |
| - |
| protected: |
| // Used in SetInkDropMode() to specify whether the ink drop effect is enabled |
| // or not for the view. In case of having an ink drop, it also specifies |
| @@ -48,7 +48,10 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost { |
| ON_NO_GESTURE_HANDLER, |
| }; |
| + static gfx::Size CalculateLargeInkDropSize(const gfx::Size small_size); |
|
sky
2016/11/02 02:52:11
const gfx::Size&
bruthig
2016/11/04 18:50:36
Done.
|
| + |
| static const int kInkDropSmallCornerRadius; |
| + static const int kInkDropLargeCornerRadius; |
|
sky
2016/11/02 02:52:11
constants before functions.
bruthig
2016/11/04 18:50:36
Done.
|
| void set_ink_drop_visible_opacity(float visible_opacity) { |
| ink_drop_visible_opacity_ = visible_opacity; |
| @@ -87,15 +90,24 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost { |
| virtual SkColor GetInkDropBaseColor() const; |
| // Should return true if the ink drop is also used to depict focus. |
| + // TODO(bruthig): Make this a configuration of InkDropImpl. |
| virtual bool ShouldShowInkDropForFocus() const; |
| InkDrop* ink_drop() { return ink_drop_.get(); } |
| // Toggle to enable/disable an InkDrop on this View. Descendants can override |
| - // CreateInkDropHighlight() and CreateInkDropRipple() to change the look/feel |
| - // of the InkDrop. |
| + // CreateInkDrop(), CreateInkDropHighlight() and CreateInkDropRipple() to |
| + // change the look/feel of the InkDrop. |
| void SetInkDropMode(InkDropMode ink_drop_mode); |
| + // Returns an InkDropImpl configured to work well with a |
| + // flood-fill ink drop ripple. |
| + std::unique_ptr<InkDropImpl> CreateDefaultFloodFillInkDropImpl(); |
| + |
| + // Returns a InkDropImpl with default configuration. The base implementation |
| + // of CreateInkDrop() delegates to this function. |
| + std::unique_ptr<InkDropImpl> CreateDefaultInkDropImpl(); |
| + |
| private: |
| class InkDropGestureHandler; |
| friend class InkDropGestureHandler; |
| @@ -110,8 +122,6 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost { |
| // destroyed |ink_drop_| during destruction. |
| std::unique_ptr<InkDropGestureHandler> gesture_handler_; |
| - gfx::Size ink_drop_size_; |
| - |
| float ink_drop_visible_opacity_; |
| // Determines whether the view was already painting to layer before adding ink |