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

Unified Diff: chromeos/dbus/fake_cras_audio_client.cc

Issue 2087803003: Sync volume state using cras signal OutputNodeVolumeChanged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/fake_cras_audio_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_cras_audio_client.cc
diff --git a/chromeos/dbus/fake_cras_audio_client.cc b/chromeos/dbus/fake_cras_audio_client.cc
index 15603915e13955965ddf7cfa9b29027370bf34fe..3ee4c4d45a829f735ae5d2ba5c8aaf77da0a7cb8 100644
--- a/chromeos/dbus/fake_cras_audio_client.cc
+++ b/chromeos/dbus/fake_cras_audio_client.cc
@@ -106,7 +106,10 @@ void FakeCrasAudioClient::GetNodes(const GetNodesCallback& callback,
}
void FakeCrasAudioClient::SetOutputNodeVolume(uint64_t node_id,
- int32_t volume) {}
+ int32_t volume) {
+ if (!notify_volume_change_with_delay_)
+ NotifyOutputNodeVolumeChangedForTesting(node_id, volume);
+}
void FakeCrasAudioClient::SetOutputUserMute(bool mute_on) {
volume_state_.output_user_mute = mute_on;
@@ -217,6 +220,13 @@ void FakeCrasAudioClient::SetAudioNodesAndNotifyObserversForTesting(
FOR_EACH_OBSERVER(Observer, observers_, NodesChanged());
}
+void FakeCrasAudioClient::NotifyOutputNodeVolumeChangedForTesting(
+ uint64_t node_id,
+ int volume) {
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OutputNodeVolumeChanged(node_id, volume));
+}
+
AudioNodeList::iterator FakeCrasAudioClient::FindNode(uint64_t node_id) {
return std::find_if(
node_list_.begin(), node_list_.end(),
« no previous file with comments | « chromeos/dbus/fake_cras_audio_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698