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

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

Issue 1682893002: Color the ink drop ripple and hover effects based on theming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit tests 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/bubble_icon_view.cc
diff --git a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
index e10f3332bd7874ac992719b7b7de84eca143af1c..409b40e81439171789cd66f7838a8d44861668c1 100644
--- a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
@@ -152,6 +152,20 @@ void BubbleIconView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
image_->SetPaintToLayer(false);
}
+gfx::Point BubbleIconView::CalculateInkDropCenter() const {
+ return GetLocalBounds().CenterPoint();
+}
+
+bool BubbleIconView::ShouldShowInkDropHover() const {
+ // BubbleIconView views don't show hover effect.
+ return false;
+}
+
+SkColor BubbleIconView::GetInkDropBaseColor() const {
+ return color_utils::DeriveDefaultIconColor(GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_TextfieldDefaultColor));
+}
+
void BubbleIconView::OnWidgetDestroying(views::Widget* widget) {
widget->RemoveObserver(this);
}
@@ -184,27 +198,16 @@ void BubbleIconView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
ink_drop_delegate_->OnLayout();
}
-gfx::Point BubbleIconView::CalculateInkDropCenter() const {
- return GetLocalBounds().CenterPoint();
-}
-
-bool BubbleIconView::ShouldShowInkDropHover() const {
- // BubbleIconView views don't show hover effect.
- return false;
-}
-
void BubbleIconView::UpdateIcon() {
if (SetRasterIcon())
return;
const int icon_size =
ui::MaterialDesignController::IsModeMaterial() ? 16 : 18;
- const ui::NativeTheme* theme = GetNativeTheme();
- SkColor icon_color =
- active_
- ? theme->GetSystemColor(ui::NativeTheme::kColorId_CallToActionColor)
- : color_utils::DeriveDefaultIconColor(theme->GetSystemColor(
- ui::NativeTheme::kColorId_TextfieldDefaultColor));
+ SkColor icon_color = active_
+ ? GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_CallToActionColor)
+ : GetInkDropBaseColor();
image_->SetImage(
gfx::CreateVectorIcon(GetVectorIcon(), icon_size, icon_color));
}

Powered by Google App Engine
This is Rietveld 408576698