93f99bf7e06432e4ddad2afe01f37f7c0ff37036
[platform/framework/web/crosswalk.git] / src / ash / system / audio / tray_audio.h
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_
6 #define ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_
7
8 #include "ash/system/audio/audio_observer.h"
9 #include "ash/system/tray/tray_image_item.h"
10 #include "base/memory/scoped_ptr.h"
11
12 namespace ash {
13
14 namespace system {
15 class TrayAudioDelegate;
16 }
17
18 namespace internal {
19
20 namespace tray {
21 class VolumeView;
22 }
23
24 class TrayAudio : public TrayImageItem,
25                   public AudioObserver {
26  public:
27   TrayAudio(SystemTray* system_tray,
28             scoped_ptr<system::TrayAudioDelegate> audio_delegate);
29   virtual ~TrayAudio();
30
31   static bool ShowAudioDeviceMenu();
32
33  protected:
34   virtual void Update();
35
36   scoped_ptr<system::TrayAudioDelegate> audio_delegate_;
37   tray::VolumeView* volume_view_;
38
39   // True if VolumeView should be created for accelerator pop up;
40   // Otherwise, it should be created for detailed view in ash tray bubble.
41   bool pop_up_volume_view_;
42
43  private:
44   // Overridden from TrayImageItem.
45   virtual bool GetInitialVisibility() OVERRIDE;
46
47   // Overridden from SystemTrayItem.
48   virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
49   virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
50   virtual void DestroyDefaultView() OVERRIDE;
51   virtual void DestroyDetailedView() OVERRIDE;
52   virtual bool ShouldHideArrow() const OVERRIDE;
53   virtual bool ShouldShowShelf() const OVERRIDE;
54
55   // Overridden from AudioObserver.
56   virtual void OnOutputVolumeChanged() OVERRIDE;
57   virtual void OnOutputMuteChanged() OVERRIDE;
58   virtual void OnAudioNodesChanged() OVERRIDE;
59   virtual void OnActiveOutputNodeChanged() OVERRIDE;
60   virtual void OnActiveInputNodeChanged() OVERRIDE;
61
62   DISALLOW_COPY_AND_ASSIGN(TrayAudio);
63 };
64
65 }  // namespace internal
66 }  // namespace ash
67
68 #endif  // ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_