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

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

Issue 1390113006: Added material design mouse hover feedback support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed the InkDropAnimationControllerImpl to destroy its timer when not running. Created 4 years, 11 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_painted_layer_delegates.h
diff --git a/ui/views/animation/ink_drop_painted_layer_delegates.h b/ui/views/animation/ink_drop_painted_layer_delegates.h
index feb2921b8a6a34fde7b136edb5b4487a9dc7a935..57d6f17dae68f42fe3d6907342188ced5151f18f 100644
--- a/ui/views/animation/ink_drop_painted_layer_delegates.h
+++ b/ui/views/animation/ink_drop_painted_layer_delegates.h
@@ -81,6 +81,31 @@ class RectangleLayerDelegate : public BasePaintedLayerDelegate {
DISALLOW_COPY_AND_ASSIGN(RectangleLayerDelegate);
};
+// A BasePaintedLayerDelegate that paints a rounded rectangle of a specified
+// color, size and corner radius.
+class RoundedRectangleLayerDelegate : public BasePaintedLayerDelegate {
+ public:
+ RoundedRectangleLayerDelegate(SkColor color,
+ gfx::Size size,
+ int corner_radius);
+ ~RoundedRectangleLayerDelegate() override;
+
+ const gfx::Size& size() const { return size_; }
+
+ // ui::LayerDelegate:
+ gfx::PointF GetCenterPoint() const override;
+ void OnPaintLayer(const ui::PaintContext& context) override;
+
+ private:
+ // The size of the rectangle.
+ gfx::Size size_;
+
+ // The radius of the corners.
+ int corner_radius_;
+
+ DISALLOW_COPY_AND_ASSIGN(RoundedRectangleLayerDelegate);
+};
+
} // namespace views
#endif // UI_VIEWS_ANIMATION_INK_DROP_PAINTED_LAYER_DELEGATES_H_
« no previous file with comments | « ui/views/animation/ink_drop_hover_unittest.cc ('k') | ui/views/animation/ink_drop_painted_layer_delegates.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698