OLD | NEW |
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 #include "device/bluetooth/dbus/bluetooth_gatt_manager_client.h" | 5 #include "device/bluetooth/dbus/bluetooth_gatt_manager_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "dbus/bus.h" | 9 #include "dbus/bus.h" |
10 #include "dbus/message.h" | 10 #include "dbus/message.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 DCHECK(object_proxy_); | 66 DCHECK(object_proxy_); |
67 object_proxy_->CallMethodWithErrorCallback( | 67 object_proxy_->CallMethodWithErrorCallback( |
68 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 68 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
69 base::Bind(&BluetoothGattManagerClientImpl::OnSuccess, | 69 base::Bind(&BluetoothGattManagerClientImpl::OnSuccess, |
70 weak_ptr_factory_.GetWeakPtr(), callback), | 70 weak_ptr_factory_.GetWeakPtr(), callback), |
71 base::Bind(&BluetoothGattManagerClientImpl::OnError, | 71 base::Bind(&BluetoothGattManagerClientImpl::OnError, |
72 weak_ptr_factory_.GetWeakPtr(), error_callback)); | 72 weak_ptr_factory_.GetWeakPtr(), error_callback)); |
73 } | 73 } |
74 | 74 |
75 protected: | 75 protected: |
76 // chromeos::DBusClient override. | 76 // bluez::DBusClient override. |
77 void Init(dbus::Bus* bus) override { | 77 void Init(dbus::Bus* bus) override { |
78 DCHECK(bus); | 78 DCHECK(bus); |
79 object_proxy_ = bus->GetObjectProxy( | 79 object_proxy_ = bus->GetObjectProxy( |
80 bluetooth_gatt_manager::kBluetoothGattManagerServiceName, | 80 bluetooth_gatt_manager::kBluetoothGattManagerServiceName, |
81 dbus::ObjectPath( | 81 dbus::ObjectPath( |
82 bluetooth_gatt_manager::kBluetoothGattManagerInterface)); | 82 bluetooth_gatt_manager::kBluetoothGattManagerInterface)); |
83 } | 83 } |
84 | 84 |
85 private: | 85 private: |
86 // Called when a response for a successful method call is received. | 86 // Called when a response for a successful method call is received. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 BluetoothGattManagerClient::BluetoothGattManagerClient() {} | 120 BluetoothGattManagerClient::BluetoothGattManagerClient() {} |
121 | 121 |
122 BluetoothGattManagerClient::~BluetoothGattManagerClient() {} | 122 BluetoothGattManagerClient::~BluetoothGattManagerClient() {} |
123 | 123 |
124 // static | 124 // static |
125 BluetoothGattManagerClient* BluetoothGattManagerClient::Create() { | 125 BluetoothGattManagerClient* BluetoothGattManagerClient::Create() { |
126 return new BluetoothGattManagerClientImpl(); | 126 return new BluetoothGattManagerClientImpl(); |
127 } | 127 } |
128 | 128 |
129 } // namespace bluez | 129 } // namespace bluez |
OLD | NEW |