| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/arc/bluetooth/arc_bluetooth_bridge.h" | 5 #include "components/arc/bluetooth/arc_bluetooth_bridge.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <iomanip> | 10 #include <iomanip> |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 void ArcBluetoothBridge::OnPoweredError( | 353 void ArcBluetoothBridge::OnPoweredError( |
| 354 const mojo::Callback<void(mojom::BluetoothAdapterState)>& callback) const { | 354 const mojo::Callback<void(mojom::BluetoothAdapterState)>& callback) const { |
| 355 LOG(WARNING) << "failed to change power state"; | 355 LOG(WARNING) << "failed to change power state"; |
| 356 | 356 |
| 357 callback.Run(bluetooth_adapter_->IsPowered() | 357 callback.Run(bluetooth_adapter_->IsPowered() |
| 358 ? mojom::BluetoothAdapterState::ON | 358 ? mojom::BluetoothAdapterState::ON |
| 359 : mojom::BluetoothAdapterState::OFF); | 359 : mojom::BluetoothAdapterState::OFF); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void ArcBluetoothBridge::OnDiscoveryStarted( | 362 void ArcBluetoothBridge::OnDiscoveryStarted( |
| 363 scoped_ptr<BluetoothDiscoverySession> session) { | 363 std::unique_ptr<BluetoothDiscoverySession> session) { |
| 364 if (!HasBluetoothInstance()) | 364 if (!HasBluetoothInstance()) |
| 365 return; | 365 return; |
| 366 | 366 |
| 367 discovery_session_ = std::move(session); | 367 discovery_session_ = std::move(session); |
| 368 | 368 |
| 369 arc_bridge_service()->bluetooth_instance()->OnDiscoveryStateChanged( | 369 arc_bridge_service()->bluetooth_instance()->OnDiscoveryStateChanged( |
| 370 mojom::BluetoothDiscoveryState::STARTED); | 370 mojom::BluetoothDiscoveryState::STARTED); |
| 371 | 371 |
| 372 SendCachedDevicesFound(); | 372 SendCachedDevicesFound(); |
| 373 } | 373 } |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 // to | 708 // to |
| 709 // make sure the bond state machine on Android is ready to take the | 709 // make sure the bond state machine on Android is ready to take the |
| 710 // pair-done event. Otherwise the pair-done event will be dropped as an | 710 // pair-done event. Otherwise the pair-done event will be dropped as an |
| 711 // invalid change of paired status. | 711 // invalid change of paired status. |
| 712 OnPairing(addr->Clone()); | 712 OnPairing(addr->Clone()); |
| 713 OnPairedDone(std::move(addr)); | 713 OnPairedDone(std::move(addr)); |
| 714 } | 714 } |
| 715 } | 715 } |
| 716 | 716 |
| 717 } // namespace arc | 717 } // namespace arc |
| OLD | NEW |