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

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

Issue 2447523002: [ash-md] Added different highlighting modes to the InkDropImpl. (Closed)
Patch Set: Fixed compile errors. Created 4 years, 1 month 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 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

Powered by Google App Engine
This is Rietveld 408576698