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

Unified Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 1406613002: For some vector icons, get the size from the vector definition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/tabs/tab.cc
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 6df01e27b9814d564359ce6c8ec0fe113a9aa4ed..6969e662ac743974df6d231a2c57c04271a6d6d6 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -132,7 +132,6 @@ const double kImmersiveTabMinThrobOpacity = 0.66;
const int kImmersiveLoadingStepCount = 32;
const char kTabCloseButtonName[] = "TabCloseButton";
-const int kTabCloseButtonSize = 16;
chrome::HostDesktopType GetHostDesktopType(views::View* view) {
// Widget is NULL when tabs are detached.
@@ -409,12 +408,12 @@ Tab::Tab(TabController* controller)
// The normal image is set by OnButtonColorMaybeChanged() because it depends
// on the current theme and active state. The hovered and pressed images
// don't depend on the these, so we can set them here.
- const gfx::ImageSkia& hovered = gfx::CreateVectorIcon(
- gfx::VectorIconId::TAB_CLOSE_HOVERED_PRESSED, kTabCloseButtonSize,
- SkColorSetARGB(0xFF, 0xDB, 0x44, 0x37));
- const gfx::ImageSkia& pressed = gfx::CreateVectorIcon(
- gfx::VectorIconId::TAB_CLOSE_HOVERED_PRESSED, kTabCloseButtonSize,
- SkColorSetARGB(0xFF, 0xA8, 0x35, 0x2A));
+ const gfx::ImageSkia& hovered =
+ gfx::CreatePrimaryVectorIcon(gfx::VectorIconId::TAB_CLOSE_HOVERED_PRESSED,
+ SkColorSetARGB(0xFF, 0xDB, 0x44, 0x37));
+ const gfx::ImageSkia& pressed =
+ gfx::CreatePrimaryVectorIcon(gfx::VectorIconId::TAB_CLOSE_HOVERED_PRESSED,
+ SkColorSetARGB(0xFF, 0xA8, 0x35, 0x2A));
close_button_->SetImage(views::CustomButton::STATE_HOVERED, &hovered);
close_button_->SetImage(views::CustomButton::STATE_PRESSED, &pressed);
@@ -1501,9 +1500,9 @@ void Tab::OnButtonColorMaybeChanged() {
button_color_ = new_button_color;
title_->SetEnabledColor(title_color);
media_indicator_button_->OnParentTabButtonColorChanged();
- const gfx::ImageSkia& close_button_normal_image = gfx::CreateVectorIcon(
- gfx::VectorIconId::TAB_CLOSE_NORMAL, kTabCloseButtonSize,
- button_color_);
+ const gfx::ImageSkia& close_button_normal_image =
+ gfx::CreatePrimaryVectorIcon(gfx::VectorIconId::TAB_CLOSE_NORMAL,
+ button_color_);
close_button_->SetImage(views::CustomButton::STATE_NORMAL,
&close_button_normal_image);
}

Powered by Google App Engine
This is Rietveld 408576698