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

Unified Diff: content/browser/bluetooth/bluetooth_device_chooser_controller.cc

Issue 2577183002: Add UMA for the number of devices in the chooser when a device is paired (Closed)
Patch Set: address comments Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/bluetooth/bluetooth_device_chooser_controller.cc
diff --git a/content/browser/bluetooth/bluetooth_device_chooser_controller.cc b/content/browser/bluetooth/bluetooth_device_chooser_controller.cc
index 6a0e22a8eb8277c5a6bad3e9f4ddd816aae8fc9b..65c13c29b780001a0f538ca7e43567b314c3f0da 100644
--- a/content/browser/bluetooth/bluetooth_device_chooser_controller.cc
+++ b/content/browser/bluetooth/bluetooth_device_chooser_controller.cc
@@ -429,8 +429,10 @@ void BluetoothDeviceChooserController::AddFilteredDevice(
MatchesFilters(device_name ? &device_name.value() : nullptr,
device.GetUUIDs(), options_->filters)) {
base::Optional<int8_t> rssi = device.GetInquiryRSSI();
+ std::string device_id = device.GetAddress();
+ device_ids_.insert(device_id);
Reilly Grant (use Gerrit) 2016/12/19 20:52:17 I was going to note that you should call device_id
juncai 2016/12/19 22:16:13 Thanks! I filed a bug for it: https://bugs.chromiu
chooser_->AddOrUpdateDevice(
- device.GetAddress(), !!device.GetName() /* should_update_name */,
+ device_id, !!device.GetName() /* should_update_name */,
device.GetNameForDisplay(), device.IsGattConnected(),
web_bluetooth_service_->IsDevicePaired(device.GetAddress()),
rssi ? CalculateSignalStrengthLevel(rssi.value()) : -1);
@@ -501,6 +503,8 @@ void BluetoothDeviceChooserController::StartDeviceDiscovery() {
return;
}
+ device_ids_.clear();
+
scanning_start_time_ = base::TimeTicks::Now();
chooser_->ShowDiscoveryState(BluetoothChooser::DiscoveryState::DISCOVERING);
@@ -588,6 +592,7 @@ void BluetoothDeviceChooserController::OnBluetoothChooserEvent(
PostErrorCallback(blink::mojom::WebBluetoothResult::CHOOSER_CANCELLED);
break;
case BluetoothChooser::Event::SELECTED:
+ RecordNumOfDevices(options_->accept_all_devices, device_ids_.size());
// RecordRequestDeviceOutcome is called in the callback, because the
// device may have vanished.
PostSuccessCallback(device_address);
« no previous file with comments | « content/browser/bluetooth/bluetooth_device_chooser_controller.h ('k') | content/browser/bluetooth/bluetooth_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698