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

Unified Diff: chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc

Issue 1724963002: Color the ink drop ripple and hover effects based on theming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review and format Created 4 years, 10 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: chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
index a8dc1224fda879c99215c43dc6f1668b9932346a..e6ab414efebafc5d4191020cba290c47245f39e1 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
@@ -12,6 +12,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/native_theme/native_theme.h"
+#include "ui/views/animation/ink_drop_hover.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/painter.h"
@@ -139,6 +140,28 @@ void IconLabelBubbleView::OnNativeThemeChanged(
SetLabelBackgroundColor(background_color);
}
+void IconLabelBubbleView::AddInkDropLayer(ui::Layer* ink_drop_layer) {
+ image()->SetPaintToLayer(true);
+ image()->SetFillsBoundsOpaquely(false);
+ InkDropHostView::AddInkDropLayer(ink_drop_layer);
+}
+
+void IconLabelBubbleView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
+ InkDropHostView::RemoveInkDropLayer(ink_drop_layer);
+ image()->SetFillsBoundsOpaquely(true);
sky 2016/02/25 00:38:32 this isn't needed (because you destroy the layer o
Evan Stade 2016/02/25 01:34:28 good call. This is a copy-pasta error so I've upda
sky 2016/02/25 02:26:55 Seems like a weird limitation on view and layer. T
+ image()->SetPaintToLayer(false);
+}
+
+scoped_ptr<views::InkDropHover> IconLabelBubbleView::CreateInkDropHover()
+ const {
+ // Location bar views don't show hover effect.
+ return nullptr;
+}
+
+SkColor IconLabelBubbleView::GetInkDropBaseColor() const {
+ return color_utils::DeriveDefaultIconColor(GetTextColor());
+}
+
SkColor IconLabelBubbleView::GetParentBackgroundColor() const {
return ui::MaterialDesignController::IsModeMaterial()
? GetNativeTheme()->GetSystemColor(

Powered by Google App Engine
This is Rietveld 408576698