| 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 "chromeos/dbus/bluetooth_gatt_service_client.h" | 5 #include "chromeos/dbus/bluetooth_gatt_service_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 "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "dbus/bus.h" | 10 #include "dbus/bus.h" |
| 11 #include "dbus/object_manager.h" | 11 #include "dbus/object_manager.h" |
| 12 #include "third_party/cros_system_api/dbus/service_constants.h" | 12 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 | 15 |
| 16 BluetoothGattServiceClient::Properties::Properties( | 16 BluetoothGattServiceClient::Properties::Properties( |
| 17 dbus::ObjectProxy* object_proxy, | 17 dbus::ObjectProxy* object_proxy, |
| 18 const std::string& interface_name, | 18 const std::string& interface_name, |
| 19 const PropertyChangedCallback&callback) | 19 const PropertyChangedCallback&callback) |
| 20 : dbus::PropertySet(object_proxy, interface_name, callback) { | 20 : dbus::PropertySet(object_proxy, interface_name, callback) { |
| 21 RegisterProperty(bluetooth_gatt_service::kUUIDProperty, &uuid); | 21 RegisterProperty(bluetooth_gatt_service::kUUIDProperty, &uuid); |
| 22 RegisterProperty(bluetooth_gatt_service::kIncludesProperty, &includes); | 22 RegisterProperty(bluetooth_gatt_service::kIncludesProperty, &includes); |
| 23 RegisterProperty(bluetooth_gatt_service::kDeviceProperty, &device); | 23 RegisterProperty(bluetooth_gatt_service::kDeviceProperty, &device); |
| 24 RegisterProperty(bluetooth_gatt_service::kPrimaryProperty, &primary); | 24 RegisterProperty(bluetooth_gatt_service::kPrimaryProperty, &primary); |
| 25 RegisterProperty(bluetooth_gatt_service::kCharacteristicsProperty, |
| 26 &characteristics); |
| 25 } | 27 } |
| 26 | 28 |
| 27 BluetoothGattServiceClient::Properties::~Properties() { | 29 BluetoothGattServiceClient::Properties::~Properties() { |
| 28 } | 30 } |
| 29 | 31 |
| 30 // The BluetoothGattServiceClient implementation used in production. | 32 // The BluetoothGattServiceClient implementation used in production. |
| 31 class BluetoothGattServiceClientImpl : public BluetoothGattServiceClient, | 33 class BluetoothGattServiceClientImpl : public BluetoothGattServiceClient, |
| 32 public dbus::ObjectManager::Interface { | 34 public dbus::ObjectManager::Interface { |
| 33 public: | 35 public: |
| 34 BluetoothGattServiceClientImpl() | 36 BluetoothGattServiceClientImpl() |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 146 |
| 145 BluetoothGattServiceClient::~BluetoothGattServiceClient() { | 147 BluetoothGattServiceClient::~BluetoothGattServiceClient() { |
| 146 } | 148 } |
| 147 | 149 |
| 148 // static | 150 // static |
| 149 BluetoothGattServiceClient* BluetoothGattServiceClient::Create() { | 151 BluetoothGattServiceClient* BluetoothGattServiceClient::Create() { |
| 150 return new BluetoothGattServiceClientImpl(); | 152 return new BluetoothGattServiceClientImpl(); |
| 151 } | 153 } |
| 152 | 154 |
| 153 } // namespace chromeos | 155 } // namespace chromeos |
| OLD | NEW |