OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/system/audio/tray_volume.h" | 5 #include "ash/system/audio/tray_volume.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/system/tray/system_tray.h" |
11 #include "ash/system/tray/system_tray_delegate.h" | 12 #include "ash/system/tray/system_tray_delegate.h" |
12 #include "ash/system/tray/tray_constants.h" | 13 #include "ash/system/tray/tray_constants.h" |
13 #include "ash/system/tray/tray_views.h" | 14 #include "ash/system/tray/tray_views.h" |
14 #include "ash/volume_control_delegate.h" | 15 #include "ash/volume_control_delegate.h" |
15 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
16 #include "grit/ash_resources.h" | 17 #include "grit/ash_resources.h" |
17 #include "grit/ash_strings.h" | 18 #include "grit/ash_strings.h" |
18 #include "third_party/skia/include/core/SkCanvas.h" | 19 #include "third_party/skia/include/core/SkCanvas.h" |
19 #include "third_party/skia/include/core/SkPaint.h" | 20 #include "third_party/skia/include/core/SkPaint.h" |
20 #include "third_party/skia/include/core/SkRect.h" | 21 #include "third_party/skia/include/core/SkRect.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 207 |
207 VolumeButton* icon_; | 208 VolumeButton* icon_; |
208 MuteButton* mute_; | 209 MuteButton* mute_; |
209 VolumeSlider* slider_; | 210 VolumeSlider* slider_; |
210 | 211 |
211 DISALLOW_COPY_AND_ASSIGN(VolumeView); | 212 DISALLOW_COPY_AND_ASSIGN(VolumeView); |
212 }; | 213 }; |
213 | 214 |
214 } // namespace tray | 215 } // namespace tray |
215 | 216 |
216 TrayVolume::TrayVolume() | 217 TrayVolume::TrayVolume(SystemTray* system_tray) |
217 : TrayImageItem(IDR_AURA_UBER_TRAY_VOLUME_MUTE), | 218 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_VOLUME_MUTE), |
218 volume_view_(NULL), | 219 volume_view_(NULL), |
219 is_default_view_(false) { | 220 is_default_view_(false) { |
220 } | 221 } |
221 | 222 |
222 TrayVolume::~TrayVolume() { | 223 TrayVolume::~TrayVolume() { |
223 } | 224 } |
224 | 225 |
225 bool TrayVolume::GetInitialVisibility() { | 226 bool TrayVolume::GetInitialVisibility() { |
226 return IsAudioMuted(); | 227 return IsAudioMuted(); |
227 } | 228 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 tray_view()->SetVisible(GetInitialVisibility()); | 272 tray_view()->SetVisible(GetInitialVisibility()); |
272 | 273 |
273 if (volume_view_) | 274 if (volume_view_) |
274 volume_view_->Update(); | 275 volume_view_->Update(); |
275 else | 276 else |
276 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); | 277 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); |
277 } | 278 } |
278 | 279 |
279 } // namespace internal | 280 } // namespace internal |
280 } // namespace ash | 281 } // namespace ash |
OLD | NEW |