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

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

Issue 2533053002: Handle view resize for ripple (Closed)
Patch Set: Addressed review comments 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
« no previous file with comments | « ash/common/system/tray/tray_popup_utils.cc ('k') | chrome/browser/ui/views/download/download_item_view.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 659cf24d630d5bb9650c000ed3693d773bb1bf91..e537f940c6f3dc29b193848be0b35e2990b808c5 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -79,6 +79,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/favicon_size.h"
+#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/paint_vector_icon.h"
@@ -165,9 +166,13 @@ gfx::ImageSkia* GetImageSkiaNamed(int id) {
return ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(id);
}
+// Ink drop ripple/highlight for bookmark buttons should be inset 1px vertically
+// so that they do not touch the bookmark bar borders.
+const gfx::Insets kInkDropInsets(1, 0);
sky 2016/11/29 05:12:34 Doesn't this result in a static initializer? Style
mohsen 2016/11/29 05:52:27 Right, my bad! However, I think style guide allows
+
gfx::Rect CalculateInkDropBounds(const gfx::Size& size) {
gfx::Rect ink_drop_bounds(size);
- ink_drop_bounds.Inset(0, 1);
+ ink_drop_bounds.Inset(kInkDropInsets);
return ink_drop_bounds;
}
@@ -225,7 +230,7 @@ class BookmarkButtonBase : public views::LabelButton {
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override {
return base::MakeUnique<views::FloodFillInkDropRipple>(
- CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(),
+ size(), kInkDropInsets, GetInkDropCenterBasedOnLastEvent(),
GetInkDropBaseColor(), ink_drop_visible_opacity());
}
@@ -348,7 +353,7 @@ class BookmarkMenuButtonBase : public views::MenuButton {
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override {
return base::MakeUnique<views::FloodFillInkDropRipple>(
- CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(),
+ size(), kInkDropInsets, GetInkDropCenterBasedOnLastEvent(),
GetInkDropBaseColor(), ink_drop_visible_opacity());
}
« no previous file with comments | « ash/common/system/tray/tray_popup_utils.cc ('k') | chrome/browser/ui/views/download/download_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698