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

Side by Side Diff: ash/system/audio/tray_audio.h

Issue 2084533008: mash: Migrate tray audio and deps to common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « ash/system/audio/audio_observer.h ('k') | ash/system/audio/tray_audio.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 <stdint.h>
9
10 #include <memory>
11
12 #include "ash/common/system/tray/tray_image_item.h"
13 #include "ash/system/audio/audio_observer.h"
14 #include "base/macros.h"
15 #include "ui/display/display_observer.h"
16
17 namespace ash {
18
19 namespace system {
20 class TrayAudioDelegate;
21 }
22
23 namespace tray {
24 class VolumeView;
25 }
26
27 class TrayAudio : public TrayImageItem,
28 public AudioObserver,
29 public display::DisplayObserver {
30 public:
31 TrayAudio(SystemTray* system_tray,
32 std::unique_ptr<system::TrayAudioDelegate> audio_delegate);
33 ~TrayAudio() override;
34
35 static bool ShowAudioDeviceMenu();
36
37 protected:
38 // Overridden from display::DisplayObserver.
39 void OnDisplayAdded(const display::Display& new_display) override;
40 void OnDisplayRemoved(const display::Display& old_display) override;
41 void OnDisplayMetricsChanged(const display::Display& display,
42 uint32_t changed_metrics) override;
43
44 virtual void Update();
45
46 std::unique_ptr<system::TrayAudioDelegate> audio_delegate_;
47 tray::VolumeView* volume_view_;
48
49 // True if VolumeView should be created for accelerator pop up;
50 // Otherwise, it should be created for detailed view in ash tray bubble.
51 bool pop_up_volume_view_;
52
53 private:
54 // Overridden from TrayImageItem.
55 bool GetInitialVisibility() override;
56
57 // Overridden from SystemTrayItem.
58 views::View* CreateDefaultView(LoginStatus status) override;
59 views::View* CreateDetailedView(LoginStatus status) override;
60 void DestroyDefaultView() override;
61 void DestroyDetailedView() override;
62 bool ShouldHideArrow() const override;
63 bool ShouldShowShelf() const override;
64
65 // Overridden from AudioObserver.
66 void OnOutputNodeVolumeChanged(uint64_t node_id, double volume) override;
67 void OnOutputMuteChanged(bool mute_on, bool system_adjust) override;
68 void OnAudioNodesChanged() override;
69 void OnActiveOutputNodeChanged() override;
70 void OnActiveInputNodeChanged() override;
71
72 void ChangeInternalSpeakerChannelMode();
73
74 DISALLOW_COPY_AND_ASSIGN(TrayAudio);
75 };
76
77 } // namespace ash
78
79 #endif // ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_
OLDNEW
« no previous file with comments | « ash/system/audio/audio_observer.h ('k') | ash/system/audio/tray_audio.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698