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 SetEndpointState(const dbus::ObjectPath& endpoint_path, bool registered); | |
armansito
2015/02/12 05:20:44
Rename this to SetEndpointRegistered?
Miao
2015/02/12 19:08:03
Done.
| |
48 | |
40 private: | 49 private: |
50 // Indicates whether the media object is visible or not. | |
51 bool visible_; | |
52 | |
53 // The path of the media object. | |
54 dbus::ObjectPath object_path_; | |
55 | |
56 // Pairs of endpoint paths and bool values indicating whether or not endpoints | |
57 // are registered. | |
58 std::map<dbus::ObjectPath, bool> endpoints_; | |
59 | |
41 // List of observers interested in event notifications from us. | 60 // List of observers interested in event notifications from us. |
42 ObserverList<BluetoothMediaClient::Observer> observers_; | 61 ObserverList<BluetoothMediaClient::Observer> observers_; |
43 | 62 |
44 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaClient); | 63 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaClient); |
45 }; | 64 }; |
46 | 65 |
47 } // namespace chromeos | 66 } // namespace chromeos |
48 | 67 |
49 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_ | 68 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_ |
OLD | NEW |