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); |
} |