OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_COMMON_SYSTEM_CHROMEOS_AUDIO_TRAY_AUDIO_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_TRAY_AUDIO_H_ |
6 #define ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_TRAY_AUDIO_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_TRAY_AUDIO_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | |
11 | |
12 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
13 #include "ash/common/system/tray/tray_image_item.h" | 11 #include "ash/common/system/tray/tray_image_item.h" |
14 #include "base/macros.h" | 12 #include "base/macros.h" |
15 #include "chromeos/audio/cras_audio_handler.h" | 13 #include "chromeos/audio/cras_audio_handler.h" |
16 #include "chromeos/dbus/power_manager_client.h" | 14 #include "chromeos/dbus/power_manager_client.h" |
17 #include "ui/display/display_observer.h" | 15 #include "ui/display/display_observer.h" |
18 | 16 |
19 namespace ash { | 17 namespace ash { |
20 | 18 |
21 namespace system { | |
22 class TrayAudioDelegate; | |
23 } | |
24 | |
25 namespace tray { | 19 namespace tray { |
26 class AudioDetailedView; | 20 class AudioDetailedView; |
27 class VolumeView; | 21 class VolumeView; |
28 } | 22 } |
29 | 23 |
30 // The system tray item for audio input and output. | 24 // The system tray item for audio input and output. |
31 class ASH_EXPORT TrayAudio : public TrayImageItem, | 25 class ASH_EXPORT TrayAudio : public TrayImageItem, |
32 public chromeos::CrasAudioHandler::AudioObserver, | 26 public chromeos::CrasAudioHandler::AudioObserver, |
33 public display::DisplayObserver, | 27 public display::DisplayObserver, |
34 public chromeos::PowerManagerClient::Observer { | 28 public chromeos::PowerManagerClient::Observer { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 63 |
70 // Overridden from chromeos::PowerManagerClient::Observer. | 64 // Overridden from chromeos::PowerManagerClient::Observer. |
71 void SuspendDone(const base::TimeDelta& sleep_duration) override; | 65 void SuspendDone(const base::TimeDelta& sleep_duration) override; |
72 | 66 |
73 // Swaps the left and right channels on yoga devices based on orientation. | 67 // Swaps the left and right channels on yoga devices based on orientation. |
74 void ChangeInternalSpeakerChannelMode(); | 68 void ChangeInternalSpeakerChannelMode(); |
75 | 69 |
76 // Updates the UI views. | 70 // Updates the UI views. |
77 void Update(); | 71 void Update(); |
78 | 72 |
79 // TODO(jamescook): Remove this delegate and inline all the code. | |
80 std::unique_ptr<system::TrayAudioDelegate> audio_delegate_; | |
81 tray::VolumeView* volume_view_; | 73 tray::VolumeView* volume_view_; |
82 | 74 |
83 // True if VolumeView should be created for accelerator pop up; | 75 // True if VolumeView should be created for accelerator pop up; |
84 // Otherwise, it should be created for detailed view in ash tray bubble. | 76 // Otherwise, it should be created for detailed view in ash tray bubble. |
85 bool pop_up_volume_view_; | 77 bool pop_up_volume_view_; |
86 | 78 |
87 tray::AudioDetailedView* audio_detail_view_; | 79 tray::AudioDetailedView* audio_detail_view_; |
88 | 80 |
89 DISALLOW_COPY_AND_ASSIGN(TrayAudio); | 81 DISALLOW_COPY_AND_ASSIGN(TrayAudio); |
90 }; | 82 }; |
91 | 83 |
92 } // namespace ash | 84 } // namespace ash |
93 | 85 |
94 #endif // ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_TRAY_AUDIO_H_ | 86 #endif // ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_TRAY_AUDIO_H_ |
OLD | NEW |