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

Unified Diff: chromeos/dbus/bluetooth_property.cc

Issue 10698027: dbus: move logic from Property<> to PropertySet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing overrides for clang Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/bluetooth_property.h ('k') | dbus/property.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/bluetooth_property.cc
diff --git a/chromeos/dbus/bluetooth_property.cc b/chromeos/dbus/bluetooth_property.cc
index d3af0783a25d1d7afa79e0b88b733ef6c8dd968c..73c67b02d3e674fae32cc1eda413a3693c14b404 100644
--- a/chromeos/dbus/bluetooth_property.cc
+++ b/chromeos/dbus/bluetooth_property.cc
@@ -28,6 +28,11 @@ void BluetoothPropertySet::ChangedReceived(dbus::Signal* signal) {
UpdatePropertyFromReader(&reader);
}
+void BluetoothPropertySet::Get(dbus::PropertyBase* property,
+ GetCallback callback) {
+ NOTREACHED() << "BlueZ does not implement Get for properties";
+}
+
void BluetoothPropertySet::GetAll() {
dbus::MethodCall method_call(interface(),
bluetooth_common::kGetProperties);
@@ -40,4 +45,22 @@ void BluetoothPropertySet::GetAll() {
GetWeakPtr()));
}
+void BluetoothPropertySet::Set(dbus::PropertyBase* property,
+ SetCallback callback) {
+ dbus::MethodCall method_call(interface(),
+ bluetooth_common::kSetProperty);
+ dbus::MessageWriter writer(&method_call);
+ writer.AppendString(property->name());
+ property->AppendSetValueToWriter(&writer);
+
+ dbus::ObjectProxy *object_proxy = this->object_proxy();
+ DCHECK(object_proxy);
+ object_proxy->CallMethod(&method_call,
+ dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ base::Bind(&dbus::PropertySet::OnSet,
+ this->GetWeakPtr(),
+ property,
+ callback));
+}
+
} // namespace chromeos
« no previous file with comments | « chromeos/dbus/bluetooth_property.h ('k') | dbus/property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698