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

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, 7 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..f0e50a25c2507fb8ee91d4efbaa4abafeed0836c 100644
--- a/components/arc/audio/arc_audio_bridge.cc
+++ b/components/arc/audio/arc_audio_bridge.cc
@@ -39,6 +39,14 @@ void ArcAudioBridge::ShowVolumeControls() {
ash::TrayAudio::ShowPopUpVolumeView();
}
+void ArcAudioBridge::OnSystemVolumeUpdateRequest(float volume) {
+ cras_audio_handler_->SetOutputVolumePercent(volume);
+ bool is_muted =
+ volume <= cras_audio_handler_->GetOutputDefaultVolumeMuteThreshold();
+ 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