| 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" |
| 11 | 11 |
| 12 namespace device { | 12 namespace device { |
| 13 | 13 |
| 14 BluetoothAdapter::ServiceOptions::ServiceOptions() { | 14 BluetoothAdapter::ServiceOptions::ServiceOptions() { |
| 15 } | 15 } |
| 16 BluetoothAdapter::ServiceOptions::~ServiceOptions() { | 16 BluetoothAdapter::ServiceOptions::~ServiceOptions() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 #if !defined(OS_CHROMEOS) && !defined(OS_WIN) && !defined(OS_MACOSX) | 19 #if !defined(OS_CHROMEOS) && !defined(OS_WIN) && !defined(OS_MACOSX) |
| 20 //static | 20 //static |
| 21 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::CreateAdapter( | 21 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::CreateAdapter( |
| 22 const InitCallback& init_callback) { | 22 const InitCallback& init_callback) { |
| 23 return base::WeakPtr<BluetoothAdapter>(); | 23 return base::WeakPtr<BluetoothAdapter>(); |
| 24 } | 24 } |
| 25 #endif // !defined(OS_CHROMEOS) && !defined(OS_WIN) && !defined(OS_MACOSX) | 25 #endif // !defined(OS_CHROMEOS) && !defined(OS_WIN) && !defined(OS_MACOSX) |
| 26 | 26 |
| 27 void BluetoothAdapter::Shutdown() { |
| 28 NOTIMPLEMENTED(); |
| 29 } |
| 30 |
| 27 BluetoothAdapter::BluetoothAdapter() | 31 BluetoothAdapter::BluetoothAdapter() |
| 28 : weak_ptr_factory_(this) { | 32 : weak_ptr_factory_(this) { |
| 29 } | 33 } |
| 30 | 34 |
| 31 BluetoothAdapter::~BluetoothAdapter() { | 35 BluetoothAdapter::~BluetoothAdapter() { |
| 32 STLDeleteValues(&devices_); | 36 STLDeleteValues(&devices_); |
| 33 } | 37 } |
| 34 | 38 |
| 35 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() { | 39 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() { |
| 36 return weak_ptr_factory_.GetWeakPtr(); | 40 return weak_ptr_factory_.GetWeakPtr(); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 147 } |
| 144 } | 148 } |
| 145 | 149 |
| 146 void BluetoothAdapter::DiscoverySessionBecameInactive( | 150 void BluetoothAdapter::DiscoverySessionBecameInactive( |
| 147 BluetoothDiscoverySession* discovery_session) { | 151 BluetoothDiscoverySession* discovery_session) { |
| 148 DCHECK(!discovery_session->IsActive()); | 152 DCHECK(!discovery_session->IsActive()); |
| 149 discovery_sessions_.erase(discovery_session); | 153 discovery_sessions_.erase(discovery_session); |
| 150 } | 154 } |
| 151 | 155 |
| 152 } // namespace device | 156 } // namespace device |
| OLD | NEW |