OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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.h" | 5 #include "device/bluetooth/bluetooth_adapter.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 return NULL; | 157 return NULL; |
158 | 158 |
159 return pairing_delegates_.front().first; | 159 return pairing_delegates_.front().first; |
160 } | 160 } |
161 | 161 |
162 void BluetoothAdapter::NotifyAdapterStateChanged(bool powered) { | 162 void BluetoothAdapter::NotifyAdapterStateChanged(bool powered) { |
163 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 163 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
164 AdapterPoweredChanged(this, powered)); | 164 AdapterPoweredChanged(this, powered)); |
165 } | 165 } |
166 | 166 |
| 167 void BluetoothAdapter::NotifyDeviceChanged(BluetoothDevice* device) { |
| 168 DCHECK(device); |
| 169 DCHECK_EQ(device->GetAdapter(), this); |
| 170 |
| 171 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
| 172 DeviceChanged(this, device)); |
| 173 } |
| 174 |
167 #if defined(OS_CHROMEOS) || defined(OS_LINUX) | 175 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
168 void BluetoothAdapter::NotifyDevicePairedChanged(BluetoothDevice* device, | 176 void BluetoothAdapter::NotifyDevicePairedChanged(BluetoothDevice* device, |
169 bool new_paired_status) { | 177 bool new_paired_status) { |
170 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 178 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
171 DevicePairedChanged(this, device, new_paired_status)); | 179 DevicePairedChanged(this, device, new_paired_status)); |
172 } | 180 } |
173 #endif | 181 #endif |
174 | 182 |
175 void BluetoothAdapter::NotifyGattServiceAdded( | 183 void BluetoothAdapter::NotifyGattServiceAdded( |
176 BluetoothRemoteGattService* service) { | 184 BluetoothRemoteGattService* service) { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 375 |
368 // static | 376 // static |
369 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome( | 377 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome( |
370 UMABluetoothDiscoverySessionOutcome outcome) { | 378 UMABluetoothDiscoverySessionOutcome outcome) { |
371 UMA_HISTOGRAM_ENUMERATION( | 379 UMA_HISTOGRAM_ENUMERATION( |
372 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), | 380 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), |
373 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); | 381 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); |
374 } | 382 } |
375 | 383 |
376 } // namespace device | 384 } // namespace device |
OLD | NEW |