Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: content/browser/bluetooth/bluetooth_device_chooser_controller.cc

Issue 2304213002: Show device connection and paired status in chooser on Mac (Closed)
Patch Set: use vector icons Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 StartDeviceDiscovery(); 346 StartDeviceDiscovery();
347 } 347 }
348 348
349 void BluetoothDeviceChooserController::AddFilteredDevice( 349 void BluetoothDeviceChooserController::AddFilteredDevice(
350 const device::BluetoothDevice& device) { 350 const device::BluetoothDevice& device) {
351 if (chooser_.get() && MatchesFilters(device, options_->filters)) { 351 if (chooser_.get() && MatchesFilters(device, options_->filters)) {
352 base::Optional<int8_t> rssi = device.GetInquiryRSSI(); 352 base::Optional<int8_t> rssi = device.GetInquiryRSSI();
353 chooser_->AddOrUpdateDevice( 353 chooser_->AddOrUpdateDevice(
354 device.GetAddress(), !!device.GetName() /* should_update_name */, 354 device.GetAddress(), !!device.GetName() /* should_update_name */,
355 device.GetNameForDisplay(), 355 device.GetNameForDisplay(),
356 // TODO(http://crbug.com/543466): Show connection and paired status. 356 device.IsGattConnected() /* is_gatt_connected */,
357 false /* is_gatt_connected */, false /* is_paired */, 357 device.IsPaired() /* is_paired */,
ortuno 2016/09/07 02:47:02 BluetoothDevice::IsPaired() returns whether or not
juncai 2016/09/09 20:06:15 Done.
358 rssi ? CalculateSignalStrengthLevel(rssi.value()) : -1); 358 rssi ? CalculateSignalStrengthLevel(rssi.value()) : -1);
359 } 359 }
360 } 360 }
361 361
362 void BluetoothDeviceChooserController::AdapterPoweredChanged(bool powered) { 362 void BluetoothDeviceChooserController::AdapterPoweredChanged(bool powered) {
363 if (!powered && discovery_session_.get()) { 363 if (!powered && discovery_session_.get()) {
364 StopDiscoverySession(std::move(discovery_session_)); 364 StopDiscoverySession(std::move(discovery_session_));
365 } 365 }
366 366
367 if (chooser_.get()) { 367 if (chooser_.get()) {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 509
510 void BluetoothDeviceChooserController::PostErrorCallback( 510 void BluetoothDeviceChooserController::PostErrorCallback(
511 blink::mojom::WebBluetoothError error) { 511 blink::mojom::WebBluetoothError error) {
512 if (!base::ThreadTaskRunnerHandle::Get()->PostTask( 512 if (!base::ThreadTaskRunnerHandle::Get()->PostTask(
513 FROM_HERE, base::Bind(error_callback_, error))) { 513 FROM_HERE, base::Bind(error_callback_, error))) {
514 LOG(WARNING) << "No TaskRunner."; 514 LOG(WARNING) << "No TaskRunner.";
515 } 515 }
516 } 516 }
517 517
518 } // namespace content 518 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698