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

Unified Diff: ash/common/system/chromeos/bluetooth/tray_bluetooth.cc

Issue 2691053003: MD system tray: Add user metrics for clicks on the Bluetooth toggle switch. (Closed)
Patch Set: Rebase Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/bluetooth/tray_bluetooth.cc
diff --git a/ash/common/system/chromeos/bluetooth/tray_bluetooth.cc b/ash/common/system/chromeos/bluetooth/tray_bluetooth.cc
index ed7284f13a6bf534169ce84bd7248fcd9f954027..6ad8627c428dbc0d52a8b3303e74a458e55bf8b0 100644
--- a/ash/common/system/chromeos/bluetooth/tray_bluetooth.cc
+++ b/ash/common/system/chromeos/bluetooth/tray_bluetooth.cc
@@ -450,12 +450,17 @@ class BluetoothDetailedView : public TrayDetailsView {
void HandleButtonPressed(views::Button* sender,
const ui::Event& event) override {
- if (sender == toggle_)
- WmShell::Get()->system_tray_delegate()->ToggleBluetooth();
- else if (sender == settings_)
+ if (sender == toggle_) {
+ SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
+ WmShell::Get()->RecordUserMetricsAction(
+ delegate->GetBluetoothEnabled() ? UMA_STATUS_AREA_BLUETOOTH_DISABLED
+ : UMA_STATUS_AREA_BLUETOOTH_ENABLED);
+ delegate->ToggleBluetooth();
+ } else if (sender == settings_) {
ShowSettings();
- else
+ } else {
NOTREACHED();
+ }
}
void CreateExtraTitleRowButtons() override {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698