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

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

Issue 1915983009: Fixed material design ink drop location for the MD download shelf buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | chrome/browser/ui/views/download/download_item_view_md.cc » ('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 23adb22f284ff1fab111fb32ade2b41d8e1af1c7..541499b1098fe4d39ea2830b0bfc5413424ec31a 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -88,6 +88,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/favicon_size.h"
+#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/scoped_canvas.h"
#include "ui/gfx/text_constants.h"
@@ -189,10 +190,10 @@ int GetHorizontalMargin() {
return kHorizontalMargin[ui::MaterialDesignController::GetMode()];
}
-gfx::Size CalculateInkDropSize(const gfx::Size& button_size) {
- gfx::Size ink_drop_size(button_size);
- ink_drop_size.Enlarge(0, -2);
- return ink_drop_size;
+gfx::Rect CalculateInkDropBounds(const gfx::Size& size) {
+ gfx::Rect ink_drop_bounds(size);
+ ink_drop_bounds.Inset(0, 1);
+ return ink_drop_bounds;
}
// BookmarkButtonBase -----------------------------------------------
@@ -240,16 +241,15 @@ class BookmarkButtonBase : public views::LabelButton {
std::unique_ptr<views::InkDropAnimation> CreateInkDropAnimation()
const override {
return base::WrapUnique(new views::FloodFillInkDropAnimation(
- CalculateInkDropSize(size()), GetInkDropCenter(),
+ CalculateInkDropBounds(size()), GetInkDropCenter(),
GetInkDropBaseColor()));
}
std::unique_ptr<views::InkDropHover> CreateInkDropHover() const override {
if (!ShouldShowInkDropHover())
return nullptr;
- return base::WrapUnique(
- new views::InkDropHover(CalculateInkDropSize(size()), 0,
- GetInkDropCenter(), GetInkDropBaseColor()));
+ return base::WrapUnique(new views::InkDropHover(
+ CalculateInkDropBounds(size()), 0, GetInkDropBaseColor()));
Evan Stade 2016/04/27 23:10:44 Do we need the new InkDropHover ctor? Why not new
bruthig 2016/04/27 23:36:28 Done.
}
SkColor GetInkDropBaseColor() const override {
@@ -341,16 +341,15 @@ class BookmarkMenuButtonBase : public views::MenuButton {
std::unique_ptr<views::InkDropAnimation> CreateInkDropAnimation()
const override {
return base::WrapUnique(new views::FloodFillInkDropAnimation(
- CalculateInkDropSize(size()), GetInkDropCenter(),
+ CalculateInkDropBounds(size()), GetInkDropCenter(),
GetInkDropBaseColor()));
}
std::unique_ptr<views::InkDropHover> CreateInkDropHover() const override {
if (!ShouldShowInkDropHover())
return nullptr;
- return base::WrapUnique(
- new views::InkDropHover(CalculateInkDropSize(size()), 0,
- GetInkDropCenter(), GetInkDropBaseColor()));
+ return base::WrapUnique(new views::InkDropHover(
+ CalculateInkDropBounds(size()), 0, GetInkDropBaseColor()));
}
SkColor GetInkDropBaseColor() const override {
« no previous file with comments | « no previous file | chrome/browser/ui/views/download/download_item_view_md.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698