OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BLUETOOTH_PROPERTY_H_ | 5 #ifndef CHROMEOS_DBUS_BLUETOOTH_PROPERTY_H_ |
6 #define CHROMEOS_DBUS_BLUETOOTH_PROPERTY_H_ | 6 #define CHROMEOS_DBUS_BLUETOOTH_PROPERTY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "dbus/message.h" | 10 #include "dbus/message.h" |
11 #include "dbus/object_proxy.h" | 11 #include "dbus/object_proxy.h" |
12 #include "dbus/property.h" | 12 #include "dbus/property.h" |
13 #include "third_party/cros_system_api/dbus/service_constants.h" | 13 #include "third_party/cros_system_api/dbus/service_constants.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 // BlueZ predates the common D-Bus Properties API (though it inspired it), | 17 // BlueZ predates the common D-Bus Properties API (though it inspired it), |
18 // override dbus::PropertySet to generate the correct method call to get | 18 // override dbus::PropertySet to generate the correct method call to get |
19 // all properties, conenect to the correct signal and parse it correctly. | 19 // all properties, conenect to the correct signal and parse it correctly. |
20 // | 20 // |
21 // BluetoothPropertySet should be used with BluetoothProperty<>. | 21 // BluetoothPropertySet should be used with BluetoothProperty<>. |
22 class BluetoothPropertySet : public dbus::PropertySet { | 22 class BluetoothPropertySet : public dbus::PropertySet { |
23 public: | 23 public: |
24 BluetoothPropertySet(dbus::ObjectProxy* object_proxy, | 24 BluetoothPropertySet(dbus::ObjectProxy* object_proxy, |
25 const std::string& interface, | 25 const std::string& interface, |
26 PropertyChangedCallback callback) | 26 const PropertyChangedCallback& callback) |
27 : dbus::PropertySet(object_proxy, interface, callback) {} | 27 : dbus::PropertySet(object_proxy, interface, callback) {} |
28 | 28 |
29 // dbus::PropertySet override. | 29 // dbus::PropertySet override. |
30 // | 30 // |
31 // Call after construction to connect property change notification | 31 // Call after construction to connect property change notification |
32 // signals. Sub-classes may override to use different D-Bus signals. | 32 // signals. Sub-classes may override to use different D-Bus signals. |
33 virtual void ConnectSignals() OVERRIDE; | 33 virtual void ConnectSignals() OVERRIDE; |
34 | 34 |
35 // dbus::PropertySet override. | 35 // dbus::PropertySet override. |
36 // | 36 // |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 87 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
88 base::Bind(&dbus::Property<T>::OnSet, | 88 base::Bind(&dbus::Property<T>::OnSet, |
89 this->GetWeakPtr(), | 89 this->GetWeakPtr(), |
90 callback)); | 90 callback)); |
91 } | 91 } |
92 }; | 92 }; |
93 | 93 |
94 } // namespace chromeos | 94 } // namespace chromeos |
95 | 95 |
96 #endif // CHROMEOS_DBUS_BLUETOOTH_PROPERTY_H_ | 96 #endif // CHROMEOS_DBUS_BLUETOOTH_PROPERTY_H_ |
OLD | NEW |