| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "device/bluetooth/bluetooth_device.h" | 9 #include "device/bluetooth/bluetooth_device.h" |
| 10 #include "device/bluetooth/bluetooth_discovery_session.h" | 10 #include "device/bluetooth/bluetooth_discovery_session.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() { | 27 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() { |
| 28 return weak_ptr_factory_.GetWeakPtr(); | 28 return weak_ptr_factory_.GetWeakPtr(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 #if defined(OS_CHROMEOS) | 31 #if defined(OS_CHROMEOS) |
| 32 void BluetoothAdapter::Shutdown() { | 32 void BluetoothAdapter::Shutdown() { |
| 33 NOTIMPLEMENTED(); | 33 NOTIMPLEMENTED(); |
| 34 } | 34 } |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) { |
| 38 DCHECK(observer); |
| 39 observers_.AddObserver(observer); |
| 40 } |
| 41 |
| 42 void BluetoothAdapter::RemoveObserver(BluetoothAdapter::Observer* observer) { |
| 43 DCHECK(observer); |
| 44 observers_.RemoveObserver(observer); |
| 45 } |
| 46 |
| 37 void BluetoothAdapter::StartDiscoverySession( | 47 void BluetoothAdapter::StartDiscoverySession( |
| 38 const DiscoverySessionCallback& callback, | 48 const DiscoverySessionCallback& callback, |
| 39 const ErrorCallback& error_callback) { | 49 const ErrorCallback& error_callback) { |
| 40 StartDiscoverySessionWithFilter(nullptr, callback, error_callback); | 50 StartDiscoverySessionWithFilter(nullptr, callback, error_callback); |
| 41 } | 51 } |
| 42 | 52 |
| 43 void BluetoothAdapter::StartDiscoverySessionWithFilter( | 53 void BluetoothAdapter::StartDiscoverySessionWithFilter( |
| 44 scoped_ptr<BluetoothDiscoveryFilter> discovery_filter, | 54 scoped_ptr<BluetoothDiscoveryFilter> discovery_filter, |
| 45 const DiscoverySessionCallback& callback, | 55 const DiscoverySessionCallback& callback, |
| 46 const ErrorCallback& error_callback) { | 56 const ErrorCallback& error_callback) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 continue; | 216 continue; |
| 207 } | 217 } |
| 208 | 218 |
| 209 result = BluetoothDiscoveryFilter::Merge(result.get(), curr_filter); | 219 result = BluetoothDiscoveryFilter::Merge(result.get(), curr_filter); |
| 210 } | 220 } |
| 211 | 221 |
| 212 return result.Pass(); | 222 return result.Pass(); |
| 213 } | 223 } |
| 214 | 224 |
| 215 } // namespace device | 225 } // namespace device |
| OLD | NEW |