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

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: fixed android build 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..089bdb81bc57d23a259d70e43f4a5c5e5fdc0bd6 100644
--- a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
+++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
@@ -32,15 +32,24 @@ void RecordInteractionWithChooser(bool has_null_handler) {
UMA_HISTOGRAM_BOOLEAN("Bluetooth.Web.ChooserInteraction", has_null_handler);
}
+void RecordNumOfDevices(size_t num_of_devices) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
+ "Bluetooth.Web.RequestDevice."
+ "NumOfDevicesInChooserWhenNotAcceptingAllDevices",
+ num_of_devices);
+}
+
} // 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 +124,8 @@ void BluetoothChooserController::Select(const std::vector<size_t>& indices) {
return;
}
DCHECK_LT(index, devices_.size());
+ if (!accept_all_devices_)
scheib 2016/12/16 06:36:16 Perhaps move the if check to the Record method?
juncai 2016/12/16 18:34:40 Done.
+ RecordNumOfDevices(devices_.size());
event_handler_.Run(content::BluetoothChooser::Event::SELECTED,
devices_[index].id);
}

Powered by Google App Engine
This is Rietveld 408576698