| 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/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "device/bluetooth/bluetooth_device.h" | 10 #include "device/bluetooth/bluetooth_device.h" |
| 11 #include "device/bluetooth/bluetooth_discovery_session.h" | 11 #include "device/bluetooth/bluetooth_discovery_session.h" |
| 12 #include "device/bluetooth/bluetooth_discovery_session_outcome.h" | 12 #include "device/bluetooth/bluetooth_discovery_session_outcome.h" |
| 13 | 13 |
| 14 namespace device { | 14 namespace device { |
| 15 | 15 |
| 16 BluetoothAdapter::ServiceOptions::ServiceOptions() { | 16 BluetoothAdapter::ServiceOptions::ServiceOptions() { |
| 17 } | 17 } |
| 18 BluetoothAdapter::ServiceOptions::~ServiceOptions() { | 18 BluetoothAdapter::ServiceOptions::~ServiceOptions() { |
| 19 } | 19 } |
| 20 | 20 |
| 21 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_MACOSX) && \ | 21 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_MACOSX) && \ |
| 22 !defined(OS_WIN) | 22 !defined(OS_WIN) && !defined(OS_LINUX) |
| 23 // static | 23 // static |
| 24 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::CreateAdapter( | 24 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::CreateAdapter( |
| 25 const InitCallback& init_callback) { | 25 const InitCallback& init_callback) { |
| 26 return base::WeakPtr<BluetoothAdapter>(); | 26 return base::WeakPtr<BluetoothAdapter>(); |
| 27 } | 27 } |
| 28 #endif // !defined(OS_CHROMEOS) && !defined(OS_WIN) && !defined(OS_MACOSX) | 28 #endif // !defined(OS_CHROMEOS) && !defined(OS_WIN) && !defined(OS_MACOSX) |
| 29 | 29 |
| 30 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() { | 30 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() { |
| 31 return weak_ptr_factory_.GetWeakPtr(); | 31 return weak_ptr_factory_.GetWeakPtr(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
| 35 void BluetoothAdapter::Shutdown() { | 35 void BluetoothAdapter::Shutdown() { |
| 36 NOTIMPLEMENTED(); | 36 NOTIMPLEMENTED(); |
| 37 } | 37 } |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) { | 40 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) { |
| 41 DCHECK(observer); | 41 DCHECK(observer); |
| 42 observers_.AddObserver(observer); | 42 observers_.AddObserver(observer); |
| 43 } | 43 } |
| 44 | 44 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 // static | 257 // static |
| 258 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome( | 258 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome( |
| 259 UMABluetoothDiscoverySessionOutcome outcome) { | 259 UMABluetoothDiscoverySessionOutcome outcome) { |
| 260 UMA_HISTOGRAM_ENUMERATION( | 260 UMA_HISTOGRAM_ENUMERATION( |
| 261 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), | 261 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), |
| 262 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); | 262 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace device | 265 } // namespace device |
| OLD | NEW |