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

Unified Diff: chrome/browser/ui/views/location_bar/bubble_icon_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: sky review 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 fd0d0f4f993f56458345d716560522d82e7dd82a..2e97656e87b78889feb15954795f0a8747a54d10 100644
--- a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
@@ -114,6 +114,10 @@ void BubbleIconView::ViewHierarchyChanged(
UpdateIcon();
}
+void BubbleIconView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
+ UpdateIcon();
+}
+
void BubbleIconView::AddInkDropLayer(ui::Layer* ink_drop_layer) {
image_->SetPaintToLayer(true);
image_->SetFillsBoundsOpaquely(false);
@@ -122,7 +126,6 @@ void BubbleIconView::AddInkDropLayer(ui::Layer* ink_drop_layer) {
void BubbleIconView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
views::InkDropHostView::RemoveInkDropLayer(ink_drop_layer);
- image_->SetFillsBoundsOpaquely(true);
image_->SetPaintToLayer(false);
}
@@ -131,8 +134,9 @@ scoped_ptr<views::InkDropHover> BubbleIconView::CreateInkDropHover() const {
return nullptr;
}
-void BubbleIconView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
- UpdateIcon();
+SkColor BubbleIconView::GetInkDropBaseColor() const {
+ return color_utils::DeriveDefaultIconColor(GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_TextfieldDefaultColor));
}
void BubbleIconView::OnGestureEvent(ui::GestureEvent* event) {
@@ -184,8 +188,7 @@ void BubbleIconView::UpdateIcon() {
SkColor icon_color =
active_
? theme->GetSystemColor(ui::NativeTheme::kColorId_CallToActionColor)
- : color_utils::DeriveDefaultIconColor(theme->GetSystemColor(
- ui::NativeTheme::kColorId_TextfieldDefaultColor));
+ : GetInkDropBaseColor();
image_->SetImage(
gfx::CreateVectorIcon(GetVectorIcon(), icon_size, icon_color));
}

Powered by Google App Engine
This is Rietveld 408576698