Chromium Code Reviews| Index: chrome/common/extensions/extension_action.cc |
| diff --git a/chrome/common/extensions/extension_action.cc b/chrome/common/extensions/extension_action.cc |
| index b2bef14906d110b257e207c05b482a0562204557..074f649719d86a793e23d3aa06a417130059cbb4 100644 |
| --- a/chrome/common/extensions/extension_action.cc |
| +++ b/chrome/common/extensions/extension_action.cc |
| @@ -191,6 +191,12 @@ class ExtensionAction::IconWithBadgeImageSource |
| const int ExtensionAction::kDefaultTabId = -1; |
| +const SkColor ExtensionAction::kGetAttentionBorderColor = |
|
Peter Kasting
2012/08/24 23:08:28
You need to get the correct colors from the themin
Jeffrey Yasskin
2012/08/29 00:37:50
Oh good. I'll figure out how to do this after send
|
| + SkColorSetRGB(0xAA, 0xAA, 0xAA); |
| +const SkColor ExtensionAction::kGetAttentionBackgroundTopColor = |
| + SkColorSetRGB(0xEC, 0xEC, 0xEC); |
| +const SkColor ExtensionAction::kGetAttentionBackgroundBottomColor = |
| + SkColorSetRGB(0xE2, 0xE2, 0xE2); |
| ExtensionAction::IconAnimation::IconAnimation( |
| ui::AnimationDelegate* delegate) |
| @@ -370,6 +376,28 @@ void ExtensionAction::ClearAllValuesForTab(int tab_id) { |
| icon_animation_.erase(tab_id); |
| } |
| +void ExtensionAction::PaintBackground(gfx::Canvas* canvas, |
| + const gfx::Rect& bounds, |
| + int tab_id) { |
| + if (WantsAttention(tab_id)) { |
| + SkPoint gradient_bounds[2] = { {SkIntToScalar(bounds.x()), |
| + SkIntToScalar(bounds.y() + 1)}, |
|
Peter Kasting
2012/08/24 23:08:28
Nit: Once you've defined LocationBar::kVisibleEdge
Jeffrey Yasskin
2012/08/29 00:37:50
This isn't necessarily the thickness of the locati
|
| + {SkIntToScalar(bounds.x()), |
| + SkIntToScalar(bounds.bottom() - 1)} }; |
| + SkColor gradient_colors[2] = { kGetAttentionBackgroundTopColor, |
| + kGetAttentionBackgroundBottomColor }; |
| + SkShader* gradient = SkGradientShader::CreateLinear( |
| + gradient_bounds, gradient_colors, NULL, 2, SkShader::kClamp_TileMode); |
| + SkPaint paint; |
| + paint.setShader(gradient); |
| + gradient->unref(); |
| + gfx::Rect bg_rect(bounds.x() - 1, bounds.y(), |
|
Peter Kasting
2012/08/24 23:08:28
Why do we draw outside our bounds? Shouldn't our
Jeffrey Yasskin
2012/08/29 00:37:50
I think this came from before I had the platform-s
|
| + bounds.width() + 1, bounds.height() - 1); |
|
Peter Kasting
2012/08/24 23:08:28
What's this last -1 mean?
Jeffrey Yasskin
2012/08/29 00:37:50
This also came from before I got the platform-spec
|
| + canvas->DrawRect(bg_rect, paint); |
| + canvas->DrawRect(bg_rect, kGetAttentionBorderColor); |
| + } |
| +} |
| + |
| void ExtensionAction::PaintBadge(gfx::Canvas* canvas, |
| const gfx::Rect& bounds, |
| int tab_id) { |