OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "chromeos/dbus/cras_audio_client.h" | 5 #include "chromeos/dbus/cras_audio_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chromeos/dbus/cras_audio_client_stub_impl.h" | 10 #include "chromeos/dbus/cras_audio_client_stub_impl.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 private: | 191 private: |
192 // Called when the cras signal is initially connected. | 192 // Called when the cras signal is initially connected. |
193 void SignalConnected(const std::string& interface_name, | 193 void SignalConnected(const std::string& interface_name, |
194 const std::string& signal_name, | 194 const std::string& signal_name, |
195 bool success) { | 195 bool success) { |
196 LOG_IF(ERROR, !success) | 196 LOG_IF(ERROR, !success) |
197 << "Failed to connect to cras signal:" << signal_name; | 197 << "Failed to connect to cras signal:" << signal_name; |
198 } | 198 } |
199 | 199 |
200 void NameOwnerChangedReceived(dbus::Signal* signal) { | 200 void NameOwnerChangedReceived(const std::string& old_owner, |
| 201 const std::string& new_owner) { |
201 FOR_EACH_OBSERVER(Observer, observers_, AudioClientRestarted()); | 202 FOR_EACH_OBSERVER(Observer, observers_, AudioClientRestarted()); |
202 } | 203 } |
203 | 204 |
204 // Called when a OutputMuteChanged signal is received. | 205 // Called when a OutputMuteChanged signal is received. |
205 void OutputMuteChangedReceived(dbus::Signal* signal) { | 206 void OutputMuteChangedReceived(dbus::Signal* signal) { |
206 // Chrome should always call SetOutputUserMute api to set the output | 207 // Chrome should always call SetOutputUserMute api to set the output |
207 // mute state and monitor user_mute state from OutputMuteChanged signal. | 208 // mute state and monitor user_mute state from OutputMuteChanged signal. |
208 dbus::MessageReader reader(signal); | 209 dbus::MessageReader reader(signal); |
209 bool system_mute, user_mute; | 210 bool system_mute, user_mute; |
210 if (!reader.PopBool(&system_mute) || !reader.PopBool(&user_mute)) { | 211 if (!reader.PopBool(&system_mute) || !reader.PopBool(&user_mute)) { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 // static | 403 // static |
403 CrasAudioClient* CrasAudioClient::Create(DBusClientImplementationType type) { | 404 CrasAudioClient* CrasAudioClient::Create(DBusClientImplementationType type) { |
404 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) { | 405 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) { |
405 return new CrasAudioClientImpl(); | 406 return new CrasAudioClientImpl(); |
406 } | 407 } |
407 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 408 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
408 return new CrasAudioClientStubImpl(); | 409 return new CrasAudioClientStubImpl(); |
409 } | 410 } |
410 | 411 |
411 } // namespace chromeos | 412 } // namespace chromeos |
OLD | NEW |