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
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_
6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_
10 #include "base/callback.h"
11 #include "base/observer_list.h"
12 #include "chromeos/chromeos_export.h"
13 #include "chromeos/dbus/bluetooth_media_client.h"
14 #include "dbus/object_path.h"
18 class CHROMEOS_EXPORT FakeBluetoothMediaClient
: public BluetoothMediaClient
{
20 // The default codec is SBC(0x00).
21 static const uint8_t kDefaultCodec
;
23 FakeBluetoothMediaClient();
24 ~FakeBluetoothMediaClient() override
;
26 // DBusClient override.
27 void Init(dbus::Bus
* bus
) override
;
29 // BluetoothMediaClient overrides.
30 void AddObserver(BluetoothMediaClient::Observer
* observer
) override
;
31 void RemoveObserver(BluetoothMediaClient::Observer
* observer
) override
;
32 void RegisterEndpoint(const dbus::ObjectPath
& object_path
,
33 const dbus::ObjectPath
& endpoint_path
,
34 const EndpointProperties
& properties
,
35 const base::Closure
& callback
,
36 const ErrorCallback
& error_callback
) override
;
37 void UnregisterEndpoint(const dbus::ObjectPath
& object_path
,
38 const dbus::ObjectPath
& endpoint_path
,
39 const base::Closure
& callback
,
40 const ErrorCallback
& error_callback
) override
;
42 // Makes the media object visible/invisible to emulate the addition/removal
44 void SetVisible(bool visible
);
46 // Sets the registration state for a given media endpoint path.
47 void SetEndpointRegistered(const dbus::ObjectPath
& endpoint_path
,
51 // Indicates whether the media object is visible or not.
54 // The path of the media object.
55 dbus::ObjectPath object_path_
;
57 // Pairs of endpoint paths and bool values indicating whether or not endpoints
59 std::map
<dbus::ObjectPath
, bool> endpoints_
;
61 // List of observers interested in event notifications from us.
62 ObserverList
<BluetoothMediaClient::Observer
> observers_
;
64 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaClient
);
67 } // namespace chromeos
69 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_