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

Unified Diff: chrome/browser/ui/bluetooth/bluetooth_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: chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
diff --git a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
index 13f85f20d01d0b085d6feee15fb0e7b9cce38d34..08a8a3def8ef651ebff0a074c856baa2aa002746 100644
--- a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
+++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
@@ -32,15 +32,26 @@ void RecordInteractionWithChooser(bool has_null_handler) {
UMA_HISTOGRAM_BOOLEAN("Bluetooth.Web.ChooserInteraction", has_null_handler);
}
+void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices) {
+ if (accept_all_devices) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
+ "Bluetooth.Web.RequestDevice."
+ "NumOfDevicesInChooserWhenNotAcceptingAllDevices",
+ num_of_devices);
Ilya Sherman 2016/12/17 01:05:45 Please cap the value that can be recorded here to
juncai 2016/12/19 20:17:57 Done.
+ }
+}
+
} // namespace
BluetoothChooserController::BluetoothChooserController(
content::RenderFrameHost* owner,
- const content::BluetoothChooser::EventHandler& event_handler)
+ const content::BluetoothChooser::EventHandler& event_handler,
+ bool accept_all_devices)
: ChooserController(owner,
IDS_BLUETOOTH_DEVICE_CHOOSER_PROMPT_ORIGIN,
IDS_BLUETOOTH_DEVICE_CHOOSER_PROMPT_EXTENSION_NAME),
- event_handler_(event_handler) {}
+ event_handler_(event_handler),
+ accept_all_devices_(accept_all_devices) {}
BluetoothChooserController::~BluetoothChooserController() {}
@@ -115,6 +126,7 @@ void BluetoothChooserController::Select(const std::vector<size_t>& indices) {
return;
}
DCHECK_LT(index, devices_.size());
+ RecordNumOfDevices(accept_all_devices_, devices_.size());
event_handler_.Run(content::BluetoothChooser::Event::SELECTED,
devices_[index].id);
}

Powered by Google App Engine
This is Rietveld 408576698