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. | |
495 for (const device::BluetoothDevice* device : adapter_->GetDevices()) { | 494 for (const device::BluetoothDevice* device : adapter_->GetDevices()) { |
496 if (device->IsGattConnected()) { | 495 if (device->IsGattConnected()) { |
497 AddFilteredDevice(*device); | 496 AddFilteredDevice(*device); |
498 } | 497 } |
499 } | 498 } |
500 } | 499 } |
501 | 500 |
502 void BluetoothDeviceChooserController::StartDeviceDiscovery() { | 501 void BluetoothDeviceChooserController::StartDeviceDiscovery() { |
503 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 502 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
504 | 503 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 | 617 |
619 void BluetoothDeviceChooserController::PostErrorCallback( | 618 void BluetoothDeviceChooserController::PostErrorCallback( |
620 blink::mojom::WebBluetoothResult error) { | 619 blink::mojom::WebBluetoothResult error) { |
621 if (!base::ThreadTaskRunnerHandle::Get()->PostTask( | 620 if (!base::ThreadTaskRunnerHandle::Get()->PostTask( |
622 FROM_HERE, base::Bind(error_callback_, error))) { | 621 FROM_HERE, base::Bind(error_callback_, error))) { |
623 LOG(WARNING) << "No TaskRunner."; | 622 LOG(WARNING) << "No TaskRunner."; |
624 } | 623 } |
625 } | 624 } |
626 | 625 |
627 } // namespace content | 626 } // namespace content |
OLD | NEW |