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

Side by Side Diff: device/bluetooth/bluetooth_adapter_android.cc

Issue 2423793002: Remove usage of FOR_EACH_OBSERVER macro in device/ (Closed)
Patch Set: rebase Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « device/bluetooth/bluetooth_adapter.cc ('k') | device/bluetooth/bluetooth_adapter_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "device/bluetooth/bluetooth_adapter_android.h" 5 #include "device/bluetooth/bluetooth_adapter_android.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 device_android->UpdateAdvertisementData( 214 device_android->UpdateAdvertisementData(
215 BluetoothDevice::ClampPower(rssi), std::move(advertised_bluetooth_uuids), 215 BluetoothDevice::ClampPower(rssi), std::move(advertised_bluetooth_uuids),
216 {} /* service_data */, 216 {} /* service_data */,
217 // Android uses INT32_MIN to indicate no Advertised Tx Power. 217 // Android uses INT32_MIN to indicate no Advertised Tx Power.
218 // https://developer.android.com/reference/android/bluetooth/le/ScanRecord .html#getTxPowerLevel() 218 // https://developer.android.com/reference/android/bluetooth/le/ScanRecord .html#getTxPowerLevel()
219 tx_power == INT32_MIN ? nullptr : &clamped_tx_power); 219 tx_power == INT32_MIN ? nullptr : &clamped_tx_power);
220 220
221 if (is_new_device) { 221 if (is_new_device) {
222 devices_.add(device_address, std::move(device_android_owner)); 222 devices_.add(device_address, std::move(device_android_owner));
223 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, 223 for (auto& observer : observers_)
224 DeviceAdded(this, device_android)); 224 observer.DeviceAdded(this, device_android);
225 } else { 225 } else {
226 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, 226 for (auto& observer : observers_)
227 DeviceChanged(this, device_android)); 227 observer.DeviceChanged(this, device_android);
228 } 228 }
229 } 229 }
230 230
231 BluetoothAdapterAndroid::BluetoothAdapterAndroid() : weak_ptr_factory_(this) { 231 BluetoothAdapterAndroid::BluetoothAdapterAndroid() : weak_ptr_factory_(this) {
232 } 232 }
233 233
234 BluetoothAdapterAndroid::~BluetoothAdapterAndroid() { 234 BluetoothAdapterAndroid::~BluetoothAdapterAndroid() {
235 Java_ChromeBluetoothAdapter_onBluetoothAdapterAndroidDestruction( 235 Java_ChromeBluetoothAdapter_onBluetoothAdapterAndroidDestruction(
236 AttachCurrentThread(), j_adapter_); 236 AttachCurrentThread(), j_adapter_);
237 } 237 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 // TODO(scheib): Support filters crbug.com/490401 325 // TODO(scheib): Support filters crbug.com/490401
326 NOTIMPLEMENTED(); 326 NOTIMPLEMENTED();
327 error_callback.Run(UMABluetoothDiscoverySessionOutcome::NOT_IMPLEMENTED); 327 error_callback.Run(UMABluetoothDiscoverySessionOutcome::NOT_IMPLEMENTED);
328 } 328 }
329 329
330 void BluetoothAdapterAndroid::RemovePairingDelegateInternal( 330 void BluetoothAdapterAndroid::RemovePairingDelegateInternal(
331 device::BluetoothDevice::PairingDelegate* pairing_delegate) { 331 device::BluetoothDevice::PairingDelegate* pairing_delegate) {
332 } 332 }
333 333
334 } // namespace device 334 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter.cc ('k') | device/bluetooth/bluetooth_adapter_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698