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

Unified Diff: ash/system/audio/tray_volume.cc

Issue 9873018: ash: Update icons for disconnected wifi, and muted audio in the tray. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « no previous file | chrome/app/theme/statusbar_network_arcs_dark.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/audio/tray_volume.cc
diff --git a/ash/system/audio/tray_volume.cc b/ash/system/audio/tray_volume.cc
index d275204cb6e18dcc94e3a4bb3340955a3bd89f09..0713499da9979a805dbba300e03d0fefd34f7455 100644
--- a/ash/system/audio/tray_volume.cc
+++ b/ash/system/audio/tray_volume.cc
@@ -60,6 +60,11 @@ class VolumeButton : public views::ToggleImageButton {
image_index = kVolumeLevel - 1;
else if (image_index == kVolumeLevel - 1)
--image_index;
+ // Index 0 is reserved for mute.
+ if (delegate->IsAudioMuted())
+ image_index = 0;
+ else
+ ++image_index;
if (image_index != image_index_) {
SkIRect region = SkIRect::MakeXYWH(0, image_index * kVolumeImageHeight,
kVolumeImageWidth, kVolumeImageHeight);
@@ -79,22 +84,6 @@ class VolumeButton : public views::ToggleImageButton {
return size;
}
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
- views::ToggleImageButton::OnPaint(canvas);
-
- ash::SystemTrayDelegate* delegate =
- ash::Shell::GetInstance()->tray_delegate();
- if (!delegate->IsAudioMuted())
- return;
-
- SkPaint paint;
- paint.setColor(SkColorSetARGB(63, 0, 0, 0));
- paint.setStrokeWidth(SkIntToScalar(3));
- canvas->sk_canvas()->drawLine(SkIntToScalar(width()),
- SkIntToScalar(10), SkIntToScalar(0), SkIntToScalar(height() - 10),
- paint);
- }
-
gfx::Image image_;
int image_index_;
@@ -128,8 +117,8 @@ class VolumeView : public views::View,
slider_->SetValue(percent);
// It is possible that the volume was (un)muted, but the actual volume level
// did not change. In that case, setting the value of the slider won't
- // trigger a repaint. So explicitly trigger a repaint.
- icon_->SchedulePaint();
+ // trigger an update. So explicitly trigger an update.
+ icon_->Update();
}
private:
« no previous file with comments | « no previous file | chrome/app/theme/statusbar_network_arcs_dark.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698