Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: chromeos/dbus/fake_bluetooth_media_client.h

Issue 910023002: device/bluetooth:Implement BluetoothMediaEndpointServiceProvider delegate and media-related overrid… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 visibility for a given media endpoint path.
47 void SetEndpointVisible(const dbus::ObjectPath& endpoint_path, bool visible);
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 their visibility.
armansito 2015/02/10 00:17:01 I find this confusing since you're using "visible"
Miao 2015/02/10 22:15:21 I shouldn't use visibility here, and yes, this ind
57 std::map<dbus::ObjectPath, bool> endpoints_;
58
41 // List of observers interested in event notifications from us. 59 // List of observers interested in event notifications from us.
42 ObserverList<BluetoothMediaClient::Observer> observers_; 60 ObserverList<BluetoothMediaClient::Observer> observers_;
43 61
44 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaClient); 62 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaClient);
45 }; 63 };
46 64
47 } // namespace chromeos 65 } // namespace chromeos
48 66
49 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_ 67 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698