ProfilePolicyConnectorFactory: Refactoring from Profile to BrowserContext.
[chromium-blink-merge.git] / ash / system / audio / tray_audio.h
blobd9ddf83fbb17504970ca15b3a87be2d7490db0f0
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.
5 #ifndef ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_
6 #define ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_
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 #include "ui/gfx/display_observer.h"
13 namespace ash {
15 namespace system {
16 class TrayAudioDelegate;
19 namespace tray {
20 class VolumeView;
23 class TrayAudio : public TrayImageItem,
24 public AudioObserver,
25 public gfx::DisplayObserver {
26 public:
27 TrayAudio(SystemTray* system_tray,
28 scoped_ptr<system::TrayAudioDelegate> audio_delegate);
29 ~TrayAudio() override;
31 static bool ShowAudioDeviceMenu();
33 protected:
34 virtual void Update();
36 scoped_ptr<system::TrayAudioDelegate> audio_delegate_;
37 tray::VolumeView* volume_view_;
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_;
43 private:
44 // Overridden from TrayImageItem.
45 bool GetInitialVisibility() override;
47 // Overridden from SystemTrayItem.
48 views::View* CreateDefaultView(user::LoginStatus status) override;
49 views::View* CreateDetailedView(user::LoginStatus status) override;
50 void DestroyDefaultView() override;
51 void DestroyDetailedView() override;
52 bool ShouldHideArrow() const override;
53 bool ShouldShowShelf() const override;
55 // Overridden from AudioObserver.
56 void OnOutputVolumeChanged() override;
57 void OnOutputMuteChanged() override;
58 void OnAudioNodesChanged() override;
59 void OnActiveOutputNodeChanged() override;
60 void OnActiveInputNodeChanged() override;
62 // Overridden from gfx::DisplayObserver.
63 void OnDisplayAdded(const gfx::Display& new_display) override;
64 void OnDisplayRemoved(const gfx::Display& old_display) override;
65 void OnDisplayMetricsChanged(const gfx::Display& display,
66 uint32_t changed_metrics) override;
68 void ChangeInternalSpeakerChannelMode();
70 DISALLOW_COPY_AND_ASSIGN(TrayAudio);
73 } // namespace ash
75 #endif // ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_