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_ENDPOINT_SERVICE_PROVIDER_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_ENDPOINT_SERVICE_PROVIDER_H_ |
6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_ENDPOINT_SERVICE_PROVIDER_H_ | 6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_ENDPOINT_SERVICE_PROVIDER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
12 #include "chromeos/dbus/bluetooth_media_endpoint_service_provider.h" | 12 #include "chromeos/dbus/bluetooth_media_endpoint_service_provider.h" |
13 #include "dbus/object_path.h" | 13 #include "dbus/object_path.h" |
14 #include "testing/gtest/include/gtest/gtest_prod.h" | |
14 | 15 |
15 namespace chromeos { | 16 namespace chromeos { |
16 | 17 |
17 // FakeBluetoothMediaEndpointServiceProvider simulates the behavior of a local | 18 // FakeBluetoothMediaEndpointServiceProvider simulates the behavior of a local |
18 // Bluetooth Media Endpoint object. | 19 // Bluetooth Media Endpoint object. |
19 // TODO(mcchou): Add the logic of the behavior. | |
20 class CHROMEOS_EXPORT FakeBluetoothMediaEndpointServiceProvider | 20 class CHROMEOS_EXPORT FakeBluetoothMediaEndpointServiceProvider |
21 : public BluetoothMediaEndpointServiceProvider { | 21 : public BluetoothMediaEndpointServiceProvider { |
22 public: | 22 public: |
23 FakeBluetoothMediaEndpointServiceProvider(const dbus::ObjectPath object_path, | 23 FakeBluetoothMediaEndpointServiceProvider(const dbus::ObjectPath object_path, |
24 Delegate* delegate); | 24 Delegate* delegate); |
25 ~FakeBluetoothMediaEndpointServiceProvider() override; | 25 ~FakeBluetoothMediaEndpointServiceProvider() override; |
26 | 26 |
27 // Each of these calls the equivalent BluetoothMediaEnpointServiceProvider:: | 27 // Each of these calls the equivalent BluetoothMediaEnpointServiceProvider:: |
28 // Delegate method on the object passed on construction. | 28 // Delegate method on the object passed on construction. |
29 void SetConfiguration(const dbus::ObjectPath& transport_path, | 29 void SetConfiguration(const dbus::ObjectPath& transport_path, |
30 const dbus::MessageReader& properties); | 30 const Delegate::TransportProperties& properties); |
31 void SelectConfiguration( | 31 void SelectConfiguration( |
32 const std::vector<uint8_t>& capabilities, | 32 const std::vector<uint8_t>& capabilities, |
33 const Delegate::SelectConfigurationCallback& callback); | 33 const Delegate::SelectConfigurationCallback& callback); |
34 void ClearConfiguration(const dbus::ObjectPath& transport_path); | 34 void ClearConfiguration(const dbus::ObjectPath& transport_path); |
35 void Release(); | 35 void Released(); |
36 | |
37 // Makes the endpoint object visible or invisible. | |
38 void SetVisible(bool visible); | |
armansito
2015/02/10 00:17:01
I think this is a bit strange, since this is an ex
Miao
2015/02/10 22:15:21
Indeed, an endpoint is an exported object, so this
| |
39 | |
40 // Gets the path of the media endpoint object. | |
41 dbus::ObjectPath object_path() const { return object_path_; } | |
36 | 42 |
37 private: | 43 private: |
38 // The fake D-Bus object path. | 44 // Indicates whether the endpoint object is visible or not. |
45 bool visible_; | |
46 | |
47 // The path of the media endpoint object. | |
39 dbus::ObjectPath object_path_; | 48 dbus::ObjectPath object_path_; |
40 | 49 |
41 // All incoming method calls are passed to |delegate_|. |callback| passed to | 50 // All incoming method calls are passed to |delegate_|. |callback| passed to |
42 // |delegate_| will generate the response for those methods which have | 51 // |delegate_| will generate the response for those methods which have |
43 // non-void return. | 52 // non-void return. |
44 Delegate* delegate_; | 53 Delegate* delegate_; |
45 | 54 |
46 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaEndpointServiceProvider); | 55 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaEndpointServiceProvider); |
47 }; | 56 }; |
48 | 57 |
49 } // namespace chromeos | 58 } // namespace chromeos |
50 | 59 |
51 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_ENDPOINT_SERVICE_PROVIDER_H_ | 60 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_ENDPOINT_SERVICE_PROVIDER_H_ |
OLD | NEW |