| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_le_advertising_manager_client.h" | 5 #include "chromeos/dbus/bluetooth_le_advertising_manager_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "dbus/bus.h" | 10 #include "dbus/bus.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 const base::Closure& callback, | 62 const base::Closure& callback, |
| 63 const ErrorCallback& error_callback) override { | 63 const ErrorCallback& error_callback) override { |
| 64 dbus::MethodCall method_call( | 64 dbus::MethodCall method_call( |
| 65 bluetooth_advertising_manager::kBluetoothAdvertisingManagerInterface, | 65 bluetooth_advertising_manager::kBluetoothAdvertisingManagerInterface, |
| 66 bluetooth_advertising_manager::kRegisterAdvertisement); | 66 bluetooth_advertising_manager::kRegisterAdvertisement); |
| 67 | 67 |
| 68 dbus::MessageWriter writer(&method_call); | 68 dbus::MessageWriter writer(&method_call); |
| 69 writer.AppendObjectPath(advertisement_object_path); | 69 writer.AppendObjectPath(advertisement_object_path); |
| 70 | 70 |
| 71 // Empty dictionary for options. | 71 // Empty dictionary for options. |
| 72 dbus::MessageWriter dict_entry_writer(NULL); | 72 dbus::MessageWriter array_writer(NULL); |
| 73 writer.OpenDictEntry(&dict_entry_writer); | 73 writer.OpenArray("{sv}", &array_writer); |
| 74 writer.CloseContainer(&dict_entry_writer); | 74 writer.CloseContainer(&array_writer); |
| 75 | |
| 76 writer.AppendObjectPath(advertisement_object_path); | |
| 77 | 75 |
| 78 DCHECK(object_manager_); | 76 DCHECK(object_manager_); |
| 79 dbus::ObjectProxy* object_proxy = | 77 dbus::ObjectProxy* object_proxy = |
| 80 object_manager_->GetObjectProxy(manager_object_path); | 78 object_manager_->GetObjectProxy(manager_object_path); |
| 81 object_proxy->CallMethodWithErrorCallback( | 79 object_proxy->CallMethodWithErrorCallback( |
| 82 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 80 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 83 base::Bind(&BluetoothAdvertisementManagerClientImpl::OnSuccess, | 81 base::Bind(&BluetoothAdvertisementManagerClientImpl::OnSuccess, |
| 84 weak_ptr_factory_.GetWeakPtr(), callback), | 82 weak_ptr_factory_.GetWeakPtr(), callback), |
| 85 base::Bind(&BluetoothAdvertisementManagerClientImpl::OnError, | 83 base::Bind(&BluetoothAdvertisementManagerClientImpl::OnError, |
| 86 weak_ptr_factory_.GetWeakPtr(), error_callback)); | 84 weak_ptr_factory_.GetWeakPtr(), error_callback)); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 180 |
| 183 BluetoothLEAdvertisingManagerClient::~BluetoothLEAdvertisingManagerClient() { | 181 BluetoothLEAdvertisingManagerClient::~BluetoothLEAdvertisingManagerClient() { |
| 184 } | 182 } |
| 185 | 183 |
| 186 BluetoothLEAdvertisingManagerClient* | 184 BluetoothLEAdvertisingManagerClient* |
| 187 BluetoothLEAdvertisingManagerClient::Create() { | 185 BluetoothLEAdvertisingManagerClient::Create() { |
| 188 return new BluetoothAdvertisementManagerClientImpl(); | 186 return new BluetoothAdvertisementManagerClientImpl(); |
| 189 } | 187 } |
| 190 | 188 |
| 191 } // namespace chromeos | 189 } // namespace chromeos |
| OLD | NEW |