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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 2839953005: Round the corners of bookmark button ink drop effects. (Closed)
Patch Set: move macro Created 3 years, 8 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
« no previous file with comments | « no previous file | ui/views/animation/ink_drop_host_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index ac5249a0234e2c45c06ea66a49c986d368fc8d48..ce37e63e3dbf78cae113307a1998cf5fb894aa80 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -90,6 +90,7 @@
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop_highlight.h"
#include "ui/views/animation/ink_drop_impl.h"
+#include "ui/views/animation/ink_drop_mask.h"
#include "ui/views/button_drag_utils.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/button/label_button_border.h"
@@ -121,6 +122,9 @@ static const int kNewTabHorizontalPadding = 2;
// Maximum size of buttons on the bookmark bar.
static const int kMaxButtonWidth = 150;
+// Corner radius for masking the ink drop effects on buttons.
+static const int kInkDropCornerRadius = 2;
+
// Number of pixels the attached bookmark bar overlaps with the toolbar.
static const int kToolbarAttachedBookmarkBarOverlap = 3;
@@ -242,6 +246,11 @@ class BookmarkButtonBase : public views::LabelButton {
bounds.size(), 0, bounds.CenterPoint(), GetInkDropBaseColor());
}
+ std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override {
+ return base::MakeUnique<views::RoundRectInkDropMask>(size(), kInkDropInsets,
+ kInkDropCornerRadius);
+ }
+
SkColor GetInkDropBaseColor() const override {
return GetThemeProvider()->GetColor(
ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON);
@@ -367,6 +376,11 @@ class BookmarkMenuButtonBase : public views::MenuButton {
bounds.size(), 0, bounds.CenterPoint(), GetInkDropBaseColor());
}
+ std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override {
+ return base::MakeUnique<views::RoundRectInkDropMask>(size(), kInkDropInsets,
+ kInkDropCornerRadius);
+ }
+
SkColor GetInkDropBaseColor() const override {
return GetThemeProvider()->GetColor(
ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON);
« no previous file with comments | « no previous file | ui/views/animation/ink_drop_host_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698