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

Unified Diff: views/controls/button/text_button.cc

Issue 7003080: Change profile menu button to avatar button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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
« views/controls/button/text_button.h ('K') | « views/controls/button/text_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/button/text_button.cc
===================================================================
--- views/controls/button/text_button.cc (revision 88024)
+++ views/controls/button/text_button.cc (working copy)
@@ -679,13 +679,7 @@
void TextButton::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
TextButtonBase::PaintButton(canvas, mode);
- SkBitmap icon = icon_;
- if (show_multiple_icon_states_) {
- if (has_hover_icon_ && (state() == BS_HOT))
- icon = icon_hover_;
- else if (has_pushed_icon_ && (state() == BS_PUSHED))
- icon = icon_pushed_;
- }
+ SkBitmap icon = GetImageToPaint();
if (icon.width() > 0) {
gfx::Rect text_bounds = GetTextBounds();
@@ -753,4 +747,14 @@
return bounds;
}
+SkBitmap TextButton::GetImageToPaint() const {
+ if (show_multiple_icon_states_) {
+ if (has_hover_icon_ && (state() == BS_HOT))
+ return icon_hover_;
+ else if (has_pushed_icon_ && (state() == BS_PUSHED))
Peter Kasting 2011/06/09 18:03:31 Nit: No else after return
sail 2011/06/10 00:56:20 Done.
+ return icon_pushed_;
+ }
+ return icon_;
+}
+
} // namespace views
« views/controls/button/text_button.h ('K') | « views/controls/button/text_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698