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

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

Issue 1711393002: bluetooth: android: register for adapter on/off events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on master Created 4 years, 9 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
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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 } 152 }
153 153
154 BluetoothDevice::PairingDelegate* BluetoothAdapter::DefaultPairingDelegate() { 154 BluetoothDevice::PairingDelegate* BluetoothAdapter::DefaultPairingDelegate() {
155 if (pairing_delegates_.empty()) 155 if (pairing_delegates_.empty())
156 return NULL; 156 return NULL;
157 157
158 return pairing_delegates_.front().first; 158 return pairing_delegates_.front().first;
159 } 159 }
160 160
161 void BluetoothAdapter::NotifyAdapterStateChanged(bool powered) {
162 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
163 AdapterPoweredChanged(this, powered));
164 }
165
161 void BluetoothAdapter::NotifyGattServiceAdded(BluetoothGattService* service) { 166 void BluetoothAdapter::NotifyGattServiceAdded(BluetoothGattService* service) {
162 DCHECK_EQ(service->GetDevice()->GetAdapter(), this); 167 DCHECK_EQ(service->GetDevice()->GetAdapter(), this);
163 168
164 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, 169 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
165 GattServiceAdded(this, service->GetDevice(), service)); 170 GattServiceAdded(this, service->GetDevice(), service));
166 } 171 }
167 172
168 void BluetoothAdapter::NotifyGattServiceRemoved(BluetoothGattService* service) { 173 void BluetoothAdapter::NotifyGattServiceRemoved(BluetoothGattService* service) {
169 DCHECK_EQ(service->GetDevice()->GetAdapter(), this); 174 DCHECK_EQ(service->GetDevice()->GetAdapter(), this);
170 175
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 355
351 // static 356 // static
352 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome( 357 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome(
353 UMABluetoothDiscoverySessionOutcome outcome) { 358 UMABluetoothDiscoverySessionOutcome outcome) {
354 UMA_HISTOGRAM_ENUMERATION( 359 UMA_HISTOGRAM_ENUMERATION(
355 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), 360 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome),
356 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); 361 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT));
357 } 362 }
358 363
359 } // namespace device 364 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698