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

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

Issue 14048007: Bluetooth: D-Bus client interface for org.bluez.Input1 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: merged Created 7 years, 8 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
(Empty)
1 // Copyright (c) 2013 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.
4
5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_INPUT_CLIENT_H_
6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_INPUT_CLIENT_H_
7
8 #include "base/callback.h"
9 #include "base/observer_list.h"
10 #include "chromeos/chromeos_export.h"
11 #include "chromeos/dbus/dbus_client_implementation_type.h"
12 #include "chromeos/dbus/experimental_bluetooth_input_client.h"
13 #include "dbus/object_path.h"
14 #include "dbus/property.h"
15
16 namespace chromeos {
17
18 // ExperimentalBluetoothInputClient is used to communicate with Bluetooth
19 // Input objects.
keybuk 2013/04/18 15:51:30 This should be changed to reflect why the Fake* cl
deymo 2013/04/18 20:20:16 Done.
20 class CHROMEOS_EXPORT FakeBluetoothInputClient
21 : public ExperimentalBluetoothInputClient {
22 public:
23 struct Properties : public ExperimentalBluetoothInputClient::Properties {
24 explicit Properties(const PropertyChangedCallback & callback);
25 virtual ~Properties();
26
27 // dbus::PropertySet override
28 virtual void Get(dbus::PropertyBase* property,
29 dbus::PropertySet::GetCallback callback) OVERRIDE;
30 virtual void GetAll() OVERRIDE;
31 virtual void Set(dbus::PropertyBase* property,
32 dbus::PropertySet::SetCallback callback) OVERRIDE;
33 };
34
35 FakeBluetoothInputClient();
36 virtual ~FakeBluetoothInputClient();
37
38 // ExperimentalBluetoothInputClient override
39 virtual void AddObserver(Observer* observer) OVERRIDE;
40 virtual void RemoveObserver(Observer* observer) OVERRIDE;
41 virtual Properties* GetProperties(const dbus::ObjectPath& object_path)
42 OVERRIDE;
43
44 // Simulate device addition/removal
45 void AddInputDevice(const dbus::ObjectPath& object_path);
46 void RemoveInputDevice(const dbus::ObjectPath& object_path);
47
48 private:
49 // Property callback passed when we create Properties* structures.
50 void OnPropertyChanged(const dbus::ObjectPath& object_path,
51 const std::string& property_name);
52
53 // Static properties we return.
54 typedef std::map<const dbus::ObjectPath, Properties *> PropertiesMap;
55 PropertiesMap properties_map_;
56
57 // List of observers interested in event notifications from us.
58 ObserverList<Observer> observers_;
59
60 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothInputClient);
61 };
62
63 } // namespace chromeos
64
65 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_INPUT_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698