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

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

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: fix cros build 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.cc
diff --git a/ui/views/animation/ink_drop_host_view.cc b/ui/views/animation/ink_drop_host_view.cc
index 85e62b88d93e8c24f9b4d3efb13a25dc2a5336bd..fb286eb97b6bf5436a4cb873f55d657cbf24da2d 100644
--- a/ui/views/animation/ink_drop_host_view.cc
+++ b/ui/views/animation/ink_drop_host_view.cc
@@ -166,8 +166,8 @@ std::unique_ptr<InkDropHighlight> InkDropHostView::CreateInkDropHighlight()
}
std::unique_ptr<InkDropRipple> InkDropHostView::CreateDefaultInkDropRipple(
- const gfx::Point& center_point,
- const gfx::Size& size) const {
+ const gfx::Point& center_point) const {
+ const gfx::Size& size = GetInkDropSize();
std::unique_ptr<InkDropRipple> ripple(new SquareInkDropRipple(
CalculateLargeInkDropSize(size), kInkDropLargeCornerRadius, size,
kInkDropSmallCornerRadius, center_point, GetInkDropBaseColor(),
@@ -176,8 +176,9 @@ std::unique_ptr<InkDropRipple> InkDropHostView::CreateDefaultInkDropRipple(
}
std::unique_ptr<InkDropHighlight>
-InkDropHostView::CreateDefaultInkDropHighlight(const gfx::PointF& center_point,
- const gfx::Size& size) const {
+InkDropHostView::CreateDefaultInkDropHighlight(
+ const gfx::PointF& center_point) const {
+ const gfx::Size& size = GetInkDropSize();
std::unique_ptr<InkDropHighlight> highlight(new InkDropHighlight(
size, kInkDropSmallCornerRadius, center_point, GetInkDropBaseColor()));
highlight->set_explode_size(CalculateLargeInkDropSize(size));
@@ -296,4 +297,9 @@ InkDropHostView::CreateDefaultFloodFillInkDropImpl() {
return ink_drop;
}
+gfx::Size InkDropHostView::GetInkDropSize() const {
+ return gfx::Size(std::min(size().width(), kDefaultInkDropSize),
bruthig 2017/03/09 05:04:42 |kDefaultInkDropSize| is somewhat of an arbitrary
Bret 2017/03/09 22:32:37 It's not just the find-in-page buttons, I modified
bruthig 2017/03/10 14:35:25 I guess I dislike the conditional 'min()' logic mo
+ std::min(size().height(), kDefaultInkDropSize));
+}
+
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698