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

Unified Diff: components/arc/audio/arc_audio_bridge.cc

Issue 2813113002: Adding ArcBridge Interface for Volume Update Requests (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/arc/audio/arc_audio_bridge.h ('k') | components/arc/common/audio.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/audio/arc_audio_bridge.cc
diff --git a/components/arc/audio/arc_audio_bridge.cc b/components/arc/audio/arc_audio_bridge.cc
index bdf7e4feafce96eb955d6e98bff5e3a6a36b2686..37a51647e75097e73f6c291b645fcda6590f19c6 100644
--- a/components/arc/audio/arc_audio_bridge.cc
+++ b/components/arc/audio/arc_audio_bridge.cc
@@ -39,6 +39,18 @@ void ArcAudioBridge::ShowVolumeControls() {
ash::TrayAudio::ShowPopUpVolumeView();
}
+void ArcAudioBridge::OnVolumeUpdateRequest(float volume) {
+ cras_audio_handler_->SetOutputVolumePercent(volume);
+ if (!cras_audio_handler_->IsOutputMuted() &&
+ volume <= cras_audio_handler_->GetOutputDefaultVolumeMuteThreshold()) {
Luis Héctor Chávez 2017/04/12 15:10:11 how about: bool is_muted = volume <= cras_audio_h
yueli 2017/04/12 20:21:59 Done.
+ cras_audio_handler_->SetOutputMute(true);
+ } else if (cras_audio_handler_->IsOutputMuted() &&
+ volume >
+ cras_audio_handler_->GetOutputDefaultVolumeMuteThreshold()) {
+ cras_audio_handler_->SetOutputMute(false);
+ }
+}
+
void ArcAudioBridge::OnAudioNodesChanged() {
uint64_t output_id = cras_audio_handler_->GetPrimaryActiveOutputNode();
const chromeos::AudioDevice* output_device =
« no previous file with comments | « components/arc/audio/arc_audio_bridge.h ('k') | components/arc/common/audio.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698