summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/status/status_area_button.cc
diff options
context:
space:
mode:
authorchocobo@chromium.org <chocobo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 18:40:00 +0000
committerchocobo@chromium.org <chocobo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 18:40:00 +0000
commit58989e64342e17a630cf98a1c8efa514eba7c1ce (patch)
tree96a241b28bd24f2b6cef94e57306629c326761c6 /chrome/browser/chromeos/status/status_area_button.cc
parent25252d649a2ffb210592e0356ea0cc38dd7747db (diff)
downloadchromium_src-58989e64342e17a630cf98a1c8efa514eba7c1ce.zip
chromium_src-58989e64342e17a630cf98a1c8efa514eba7c1ce.tar.gz
chromium_src-58989e64342e17a630cf98a1c8efa514eba7c1ce.tar.bz2
New network icons for ChromeOS
TEST=none BUGS=none Review URL: http://codereview.chromium.org/634001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39462 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/status/status_area_button.cc')
-rw-r--r--chrome/browser/chromeos/status/status_area_button.cc31
1 files changed, 13 insertions, 18 deletions
diff --git a/chrome/browser/chromeos/status/status_area_button.cc b/chrome/browser/chromeos/status/status_area_button.cc
index 9a4a0f3..d779eea 100644
--- a/chrome/browser/chromeos/status/status_area_button.cc
+++ b/chrome/browser/chromeos/status/status_area_button.cc
@@ -23,28 +23,23 @@ StatusAreaButton::StatusAreaButton(views::ViewMenuDelegate* menu_delegate)
}
void StatusAreaButton::Paint(gfx::Canvas* canvas, bool for_drag) {
- int bitmap_id;
-
- switch (state()) {
- case BS_NORMAL:
- bitmap_id = IDR_STATUSBAR_CONTAINER;
- break;
- case BS_HOT:
- bitmap_id = IDR_STATUSBAR_CONTAINER_HOVER;
- break;
- case BS_PUSHED:
- bitmap_id = IDR_STATUSBAR_CONTAINER_PRESSED;
- break;
- default:
- bitmap_id = IDR_STATUSBAR_CONTAINER;
- NOTREACHED();
+ if (state() == BS_PUSHED) {
+ canvas->DrawBitmapInt(*ResourceBundle::GetSharedInstance().
+ GetBitmapNamed(IDR_STATUSBAR_PRESSED), 0, 0);
}
- SkBitmap* container =
- ResourceBundle::GetSharedInstance().GetBitmapNamed(bitmap_id);
- canvas->DrawBitmapInt(*container, 0, 0);
DrawIcon(canvas);
}
+gfx::Size StatusAreaButton::GetPreferredSize() {
+ // icons are 24x24
+ static const int kIconWidth = 24;
+ static const int kIconHeight = 24;
+ gfx::Insets insets = GetInsets();
+ gfx::Size prefsize(kIconWidth + insets.width(),
+ kIconHeight + insets.height());
+ return prefsize;
+}
+
void StatusAreaButton::DrawIcon(gfx::Canvas* canvas) {
canvas->DrawBitmapInt(icon(), 0, 0);
}