OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/chromeos/dbus/bluetooth_property.h" | |
6 | |
7 #include "base/bind.h" | |
8 #include "dbus/message.h" | |
9 #include "dbus/object_proxy.h" | |
10 #include "third_party/cros_system_api/dbus/service_constants.h" | |
11 | |
12 namespace chromeos { | |
13 | |
14 void BluetoothPropertySet::ConnectSignals() { | |
15 dbus::ObjectProxy* object_proxy = this->object_proxy(); | |
16 DCHECK(object_proxy); | |
17 object_proxy->ConnectToSignal( | |
18 interface(), | |
19 bluetooth_common::kPropertyChangedSignal, | |
20 base::Bind(&dbus::PropertySet::ChangedReceived, GetWeakPtr()), | |
21 base::Bind(&dbus::PropertySet::ChangedConnected, GetWeakPtr())); | |
22 } | |
23 | |
24 void BluetoothPropertySet::ChangedReceived(dbus::Signal* signal) { | |
25 DCHECK(signal); | |
26 | |
27 dbus::MessageReader reader(signal); | |
28 UpdatePropertyFromReader(&reader); | |
29 } | |
30 | |
31 void BluetoothPropertySet::GetAll() { | |
32 dbus::MethodCall method_call(interface(), | |
33 bluetooth_common::kGetProperties); | |
34 | |
35 dbus::ObjectProxy* object_proxy = this->object_proxy(); | |
36 DCHECK(object_proxy); | |
37 object_proxy->CallMethod(&method_call, | |
38 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | |
39 base::Bind(&dbus::PropertySet::OnGetAll, | |
40 GetWeakPtr())); | |
41 } | |
42 | |
43 } | |
OLD | NEW |