| 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 503bdc35c55f258455a4b0ca1697338a2b4996c7..c61c1f091d9815c231e0f262cb4475e314ac162b 100644
|
| --- a/ui/views/animation/ink_drop_host_view.h
|
| +++ b/ui/views/animation/ink_drop_host_view.h
|
| @@ -15,14 +15,12 @@
|
| #include "ui/views/view.h"
|
|
|
| namespace views {
|
| +class InkDropImpl;
|
|
|
| namespace test {
|
| class InkDropHostViewTestApi;
|
| } // namespace test
|
|
|
| -class InkDropRipple;
|
| -class InkDropHighlight;
|
| -
|
| // A view that provides InkDropHost functionality.
|
| class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost {
|
| public:
|
| @@ -42,18 +40,25 @@ 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; }
|
| -
|
| // Toggle to enable/disable an InkDrop on this View. Descendants can override
|
| // CreateInkDropHighlight() and CreateInkDropRipple() to change the look/feel
|
| // of the InkDrop.
|
| + //
|
| + // TODO(bruthig): Add an easier mechanism than overriding functions to allow
|
| + // subclasses/clients to specify the flavor of ink drop.
|
| void SetInkDropMode(InkDropMode ink_drop_mode);
|
|
|
| protected:
|
| static const int kInkDropSmallCornerRadius;
|
| + static const int kInkDropLargeCornerRadius;
|
| +
|
| + // Returns a large ink drop size based on the |small_size| that works well
|
| + // with the SquareInkDropRipple animation durations.
|
| + static gfx::Size CalculateLargeInkDropSize(const gfx::Size& small_size);
|
|
|
| void set_ink_drop_visible_opacity(float visible_opacity) {
|
| ink_drop_visible_opacity_ = visible_opacity;
|
| @@ -91,14 +96,19 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost {
|
| // ink drop.
|
| virtual SkColor GetInkDropBaseColor() const;
|
|
|
| - // Should return true if the ink drop is also used to depict focus.
|
| - virtual bool ShouldShowInkDropForFocus() const;
|
| -
|
| // Provides access to |ink_drop_|. Implements lazy initialization of
|
| // |ink_drop_| so as to avoid virtual method calls during construction since
|
| // subclasses should be able to call SetInkDropMode() during construction.
|
| InkDrop* GetInkDrop();
|
|
|
| + // Returns an InkDropImpl configured to work well with a
|
| + // flood-fill ink drop ripple.
|
| + std::unique_ptr<InkDropImpl> CreateDefaultFloodFillInkDropImpl();
|
| +
|
| + // Returns an InkDropImpl with default configuration. The base implementation
|
| + // of CreateInkDrop() delegates to this function.
|
| + std::unique_ptr<InkDropImpl> CreateDefaultInkDropImpl();
|
| +
|
| private:
|
| class InkDropGestureHandler;
|
| friend class InkDropGestureHandler;
|
| @@ -117,8 +127,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
|
|
|