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

Unified Diff: ui/views/controls/button/vector_icon_button.cc

Issue 2610163003: Create vector icon resource directory specific to Chrome. (Closed)
Patch Set: fix oversight Created 3 years, 11 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 | « ui/views/controls/button/vector_icon_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/vector_icon_button.cc
diff --git a/ui/views/controls/button/vector_icon_button.cc b/ui/views/controls/button/vector_icon_button.cc
index 2c6b70d4b350a66f248832038e87c7dff543bdb3..b3dbca975e4e8ed90c29dc93d6ece94d6a7ec8f6 100644
--- a/ui/views/controls/button/vector_icon_button.cc
+++ b/ui/views/controls/button/vector_icon_button.cc
@@ -44,10 +44,19 @@ void VectorIconButton::SetIcon(gfx::VectorIconId id) {
}
}
+void VectorIconButton::SetIcon(const gfx::VectorIcon& icon) {
+ icon_ = &icon;
+ SetIcon(gfx::VectorIconId::VECTOR_ICON_NONE);
+}
+
void VectorIconButton::OnThemeChanged() {
SkColor icon_color =
color_utils::DeriveDefaultIconColor(delegate_->GetVectorIconBaseColor());
- gfx::ImageSkia image = gfx::CreateVectorIcon(id_, icon_color);
+ gfx::ImageSkia image;
+ if (icon_)
+ image = gfx::CreateVectorIcon(*icon_, icon_color);
+ else
+ image = gfx::CreateVectorIcon(id_, icon_color);
SetImage(views::CustomButton::STATE_NORMAL, &image);
image = gfx::CreateVectorIcon(id_, SkColorSetA(icon_color, 0xff / 2));
SetImage(views::CustomButton::STATE_DISABLED, &image);
« no previous file with comments | « ui/views/controls/button/vector_icon_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698