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

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

Issue 2037173003: Notify the BluetoothAdapter::Observer when a bluetooth peripheral disconnects on Android and Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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.h ('k') | device/bluetooth/bluetooth_device.cc » ('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 (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
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
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
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter.h ('k') | device/bluetooth/bluetooth_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698