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 "content/browser/bluetooth/bluetooth_device_chooser_controller.h" | 5 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <unordered_set> | 9 #include <unordered_set> |
10 | 10 |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 RecordRSSISignalStrengthLevel(content::UMARSSISignalStrengthLevel::LEVEL_4); | 484 RecordRSSISignalStrengthLevel(content::UMARSSISignalStrengthLevel::LEVEL_4); |
485 return 4; | 485 return 4; |
486 } | 486 } |
487 } | 487 } |
488 | 488 |
489 void BluetoothDeviceChooserController::SetTestScanDurationForTesting() { | 489 void BluetoothDeviceChooserController::SetTestScanDurationForTesting() { |
490 BluetoothDeviceChooserController::use_test_scan_duration_ = true; | 490 BluetoothDeviceChooserController::use_test_scan_duration_ = true; |
491 } | 491 } |
492 | 492 |
493 void BluetoothDeviceChooserController::PopulateConnectedDevices() { | 493 void BluetoothDeviceChooserController::PopulateConnectedDevices() { |
| 494 // TODO(crbug.com/728897): Use RetrieveGattConnectedDevices once implemented. |
494 for (const device::BluetoothDevice* device : adapter_->GetDevices()) { | 495 for (const device::BluetoothDevice* device : adapter_->GetDevices()) { |
495 if (device->IsGattConnected()) { | 496 if (device->IsGattConnected()) { |
496 AddFilteredDevice(*device); | 497 AddFilteredDevice(*device); |
497 } | 498 } |
498 } | 499 } |
499 } | 500 } |
500 | 501 |
501 void BluetoothDeviceChooserController::StartDeviceDiscovery() { | 502 void BluetoothDeviceChooserController::StartDeviceDiscovery() { |
502 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 503 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
503 | 504 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 | 618 |
618 void BluetoothDeviceChooserController::PostErrorCallback( | 619 void BluetoothDeviceChooserController::PostErrorCallback( |
619 blink::mojom::WebBluetoothResult error) { | 620 blink::mojom::WebBluetoothResult error) { |
620 if (!base::ThreadTaskRunnerHandle::Get()->PostTask( | 621 if (!base::ThreadTaskRunnerHandle::Get()->PostTask( |
621 FROM_HERE, base::Bind(error_callback_, error))) { | 622 FROM_HERE, base::Bind(error_callback_, error))) { |
622 LOG(WARNING) << "No TaskRunner."; | 623 LOG(WARNING) << "No TaskRunner."; |
623 } | 624 } |
624 } | 625 } |
625 | 626 |
626 } // namespace content | 627 } // namespace content |
OLD | NEW |