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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) { | 48 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) { |
49 DCHECK(observer); | 49 DCHECK(observer); |
50 observers_.AddObserver(observer); | 50 observers_.AddObserver(observer); |
51 } | 51 } |
52 | 52 |
53 void BluetoothAdapter::RemoveObserver(BluetoothAdapter::Observer* observer) { | 53 void BluetoothAdapter::RemoveObserver(BluetoothAdapter::Observer* observer) { |
54 DCHECK(observer); | 54 DCHECK(observer); |
55 observers_.RemoveObserver(observer); | 55 observers_.RemoveObserver(observer); |
56 } | 56 } |
57 | 57 |
| 58 bool BluetoothAdapter::HasObserver(BluetoothAdapter::Observer* observer) { |
| 59 DCHECK(observer); |
| 60 return observers_.HasObserver(observer); |
| 61 } |
| 62 |
58 void BluetoothAdapter::StartDiscoverySession( | 63 void BluetoothAdapter::StartDiscoverySession( |
59 const DiscoverySessionCallback& callback, | 64 const DiscoverySessionCallback& callback, |
60 const ErrorCallback& error_callback) { | 65 const ErrorCallback& error_callback) { |
61 StartDiscoverySessionWithFilter(nullptr, callback, error_callback); | 66 StartDiscoverySessionWithFilter(nullptr, callback, error_callback); |
62 } | 67 } |
63 | 68 |
64 void BluetoothAdapter::StartDiscoverySessionWithFilter( | 69 void BluetoothAdapter::StartDiscoverySessionWithFilter( |
65 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, | 70 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, |
66 const DiscoverySessionCallback& callback, | 71 const DiscoverySessionCallback& callback, |
67 const ErrorCallback& error_callback) { | 72 const ErrorCallback& error_callback) { |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 UMA_HISTOGRAM_ENUMERATION( | 416 UMA_HISTOGRAM_ENUMERATION( |
412 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), | 417 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), |
413 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); | 418 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); |
414 } | 419 } |
415 | 420 |
416 // static | 421 // static |
417 const base::TimeDelta BluetoothAdapter::timeoutSec = | 422 const base::TimeDelta BluetoothAdapter::timeoutSec = |
418 base::TimeDelta::FromSeconds(180); | 423 base::TimeDelta::FromSeconds(180); |
419 | 424 |
420 } // namespace device | 425 } // namespace device |
OLD | NEW |