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

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

Issue 2813113002: Adding ArcBridge Interface for Volume Update Requests (Closed)
Patch Set: Adding ArcBridge Interface for Volume Update Requests Created 3 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 side-by-side diff with in-line comments
Download patch
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 9a0da08829a5e88cb2ac299b71b027dd542637fd..a3eb2719f21404eb3d926b07b8738c685de5025b 100644
--- a/components/arc/audio/arc_audio_bridge.cc
+++ b/components/arc/audio/arc_audio_bridge.cc
@@ -39,6 +39,16 @@ void ArcAudioBridge::ShowVolumeControls() {
ash::TrayAudio::ShowPopUpVolumeView();
}
+void ArcAudioBridge::OnSystemVolumeUpdateRequest(int32_t percent) {
+ if (percent < 0 || percent > 100)
+ return;
+ cras_audio_handler_->SetOutputVolumePercent(percent);
+ bool is_muted =
+ percent <= cras_audio_handler_->GetOutputDefaultVolumeMuteThreshold();
dcheng 2017/06/06 18:45:38 FWIW, it seems like this is already down in CrasAu
yueli 2017/06/06 20:01:40 IIUC SetOutputMute will change the device mute set
+ if (cras_audio_handler_->IsOutputMuted() != is_muted)
+ cras_audio_handler_->SetOutputMute(is_muted);
+}
+
void ArcAudioBridge::OnAudioNodesChanged() {
uint64_t output_id = cras_audio_handler_->GetPrimaryActiveOutputNode();
const chromeos::AudioDevice* output_device =

Powered by Google App Engine
This is Rietveld 408576698