OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_ |
6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_ |
7 | 7 |
| 8 #include <map> |
| 9 |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
10 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
11 #include "chromeos/dbus/bluetooth_media_client.h" | 13 #include "chromeos/dbus/bluetooth_media_client.h" |
12 #include "dbus/object_path.h" | 14 #include "dbus/object_path.h" |
13 | 15 |
14 namespace chromeos { | 16 namespace chromeos { |
15 | 17 |
16 class CHROMEOS_EXPORT FakeBluetoothMediaClient : public BluetoothMediaClient { | 18 class CHROMEOS_EXPORT FakeBluetoothMediaClient : public BluetoothMediaClient { |
17 public: | 19 public: |
(...skipping 12 matching lines...) Expand all Loading... |
30 void RegisterEndpoint(const dbus::ObjectPath& object_path, | 32 void RegisterEndpoint(const dbus::ObjectPath& object_path, |
31 const dbus::ObjectPath& endpoint_path, | 33 const dbus::ObjectPath& endpoint_path, |
32 const EndpointProperties& properties, | 34 const EndpointProperties& properties, |
33 const base::Closure& callback, | 35 const base::Closure& callback, |
34 const ErrorCallback& error_callback) override; | 36 const ErrorCallback& error_callback) override; |
35 void UnregisterEndpoint(const dbus::ObjectPath& object_path, | 37 void UnregisterEndpoint(const dbus::ObjectPath& object_path, |
36 const dbus::ObjectPath& endpoint_path, | 38 const dbus::ObjectPath& endpoint_path, |
37 const base::Closure& callback, | 39 const base::Closure& callback, |
38 const ErrorCallback& error_callback) override; | 40 const ErrorCallback& error_callback) override; |
39 | 41 |
| 42 // Makes the media object visible/invisible to emulate the addition/removal |
| 43 // events. |
| 44 void SetVisible(bool visible); |
| 45 |
| 46 // Sets the registration state for a given media endpoint path. |
| 47 void SetEndpointRegistered(const dbus::ObjectPath& endpoint_path, |
| 48 bool registered); |
| 49 |
40 private: | 50 private: |
| 51 // Indicates whether the media object is visible or not. |
| 52 bool visible_; |
| 53 |
| 54 // The path of the media object. |
| 55 dbus::ObjectPath object_path_; |
| 56 |
| 57 // Pairs of endpoint paths and bool values indicating whether or not endpoints |
| 58 // are registered. |
| 59 std::map<dbus::ObjectPath, bool> endpoints_; |
| 60 |
41 // List of observers interested in event notifications from us. | 61 // List of observers interested in event notifications from us. |
42 ObserverList<BluetoothMediaClient::Observer> observers_; | 62 ObserverList<BluetoothMediaClient::Observer> observers_; |
43 | 63 |
44 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaClient); | 64 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaClient); |
45 }; | 65 }; |
46 | 66 |
47 } // namespace chromeos | 67 } // namespace chromeos |
48 | 68 |
49 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_ | 69 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_ |
OLD | NEW |