OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h
" | 5 #include "components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h
" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 void BluetoothLowEnergyConnectionFinder::StopDiscoverySession() { | 123 void BluetoothLowEnergyConnectionFinder::StopDiscoverySession() { |
124 VLOG(1) << "Stopping discovery sesison"; | 124 VLOG(1) << "Stopping discovery sesison"; |
125 | 125 |
126 if (!adapter_) { | 126 if (!adapter_) { |
127 VLOG(1) << "Adapter not initialized"; | 127 VLOG(1) << "Adapter not initialized"; |
128 return; | 128 return; |
129 } | 129 } |
130 if (!discovery_session_ || !discovery_session_->IsActive()) { | 130 if (!discovery_session_ || !discovery_session_->IsActive()) { |
131 VLOG(1) << "No Active discovery session"; | 131 VLOG(1) << "No Active discovery session"; |
| 132 return; |
132 } | 133 } |
133 | 134 |
134 discovery_session_->Stop( | 135 discovery_session_->Stop( |
135 base::Bind(&BluetoothLowEnergyConnectionFinder::OnDiscoverySessionStopped, | 136 base::Bind(&BluetoothLowEnergyConnectionFinder::OnDiscoverySessionStopped, |
136 weak_ptr_factory_.GetWeakPtr()), | 137 weak_ptr_factory_.GetWeakPtr()), |
137 base::Bind( | 138 base::Bind( |
138 &BluetoothLowEnergyConnectionFinder::OnStopDiscoverySessionError, | 139 &BluetoothLowEnergyConnectionFinder::OnStopDiscoverySessionError, |
139 weak_ptr_factory_.GetWeakPtr())); | 140 weak_ptr_factory_.GetWeakPtr())); |
140 } | 141 } |
141 | 142 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 << "device = " << remote_device->GetAddress() | 176 << "device = " << remote_device->GetAddress() |
176 << ", name = " << remote_device->GetName(); | 177 << ", name = " << remote_device->GetName(); |
177 remote_device->CreateGattConnection( | 178 remote_device->CreateGattConnection( |
178 base::Bind(&BluetoothLowEnergyConnectionFinder::OnConnectionCreated, | 179 base::Bind(&BluetoothLowEnergyConnectionFinder::OnConnectionCreated, |
179 weak_ptr_factory_.GetWeakPtr()), | 180 weak_ptr_factory_.GetWeakPtr()), |
180 base::Bind(&BluetoothLowEnergyConnectionFinder::OnCreateConnectionError, | 181 base::Bind(&BluetoothLowEnergyConnectionFinder::OnCreateConnectionError, |
181 weak_ptr_factory_.GetWeakPtr())); | 182 weak_ptr_factory_.GetWeakPtr())); |
182 } | 183 } |
183 | 184 |
184 } // namespace proximity_auth | 185 } // namespace proximity_auth |
OLD | NEW |