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 #ifndef ASH_SYSTEM_AUDIO_TRAY_VOLUME_H_ | 5 #ifndef ASH_SYSTEM_AUDIO_TRAY_VOLUME_H_ |
6 #define ASH_SYSTEM_AUDIO_TRAY_VOLUME_H_ | 6 #define ASH_SYSTEM_AUDIO_TRAY_VOLUME_H_ |
7 | 7 |
8 #include "ash/system/audio/audio_observer.h" | 8 #include "ash/system/audio/audio_observer.h" |
9 #include "ash/system/tray/tray_image_item.h" | 9 #include "ash/system/tray/tray_image_item.h" |
10 | 10 |
11 namespace ash { | 11 namespace ash { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 namespace tray { | 14 namespace tray { |
15 class VolumeView; | 15 class VolumeView; |
16 } | 16 } |
17 | 17 |
18 class TrayVolume : public TrayImageItem, | 18 class TrayVolume : public TrayImageItem, |
19 public AudioObserver { | 19 public AudioObserver { |
20 public: | 20 public: |
21 TrayVolume(); | 21 TrayVolume(); |
22 virtual ~TrayVolume(); | 22 virtual ~TrayVolume(); |
23 | 23 |
24 private: | 24 private: |
25 // Overridden from TrayImageItem. | 25 // Overridden from TrayImageItem. |
26 virtual bool GetInitialVisibility() OVERRIDE; | 26 virtual bool GetInitialVisibility() OVERRIDE; |
27 | 27 |
28 // Overridden from SystemTrayItem. | 28 // Overridden from SystemTrayItem. |
29 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 29 virtual views::View* CreateDefaultView(user::LoginStatus status, |
| 30 int bubble_width) OVERRIDE; |
30 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; | 31 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; |
31 virtual void DestroyDefaultView() OVERRIDE; | 32 virtual void DestroyDefaultView() OVERRIDE; |
32 virtual void DestroyDetailedView() OVERRIDE; | 33 virtual void DestroyDetailedView() OVERRIDE; |
33 virtual bool ShouldShowLauncher() const OVERRIDE; | 34 virtual bool ShouldShowLauncher() const OVERRIDE; |
34 | 35 |
35 // Overridden from AudioObserver. | 36 // Overridden from AudioObserver. |
36 virtual void OnVolumeChanged(float percent) OVERRIDE; | 37 virtual void OnVolumeChanged(float percent) OVERRIDE; |
37 virtual void OnMuteToggled() OVERRIDE; | 38 virtual void OnMuteToggled() OVERRIDE; |
38 | 39 |
39 tray::VolumeView* volume_view_; | 40 tray::VolumeView* volume_view_; |
40 | 41 |
41 // Was |volume_view_| created for CreateDefaultView() rather than | 42 // Was |volume_view_| created for CreateDefaultView() rather than |
42 // CreateDetailedView()? Used to avoid resetting |volume_view_| | 43 // CreateDetailedView()? Used to avoid resetting |volume_view_| |
43 // inappropriately in DestroyDefaultView() or DestroyDetailedView(). | 44 // inappropriately in DestroyDefaultView() or DestroyDetailedView(). |
44 bool is_default_view_; | 45 bool is_default_view_; |
45 | 46 |
46 DISALLOW_COPY_AND_ASSIGN(TrayVolume); | 47 DISALLOW_COPY_AND_ASSIGN(TrayVolume); |
47 }; | 48 }; |
48 | 49 |
49 } // namespace internal | 50 } // namespace internal |
50 } // namespace ash | 51 } // namespace ash |
51 | 52 |
52 #endif // ASH_SYSTEM_AUDIO_TRAY_VOLUME_H_ | 53 #endif // ASH_SYSTEM_AUDIO_TRAY_VOLUME_H_ |
OLD | NEW |