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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth.h" 5 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth.h"
6 6
7 #include "ash/common/session/session_state_delegate.h" 7 #include "ash/common/session/session_state_delegate.h"
8 #include "ash/common/system/tray/hover_highlight_view.h" 8 #include "ash/common/system/tray/hover_highlight_view.h"
9 #include "ash/common/system/tray/system_tray.h" 9 #include "ash/common/system/tray/system_tray.h"
10 #include "ash/common/system/tray/system_tray_delegate.h" 10 #include "ash/common/system/tray/system_tray_delegate.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 const std::string device_id = find->second; 443 const std::string device_id = find->second;
444 if (FoundDevice(device_id, connecting_devices_, nullptr, nullptr)) 444 if (FoundDevice(device_id, connecting_devices_, nullptr, nullptr))
445 return; 445 return;
446 446
447 UpdateClickedDevice(device_id, view); 447 UpdateClickedDevice(device_id, view);
448 delegate->ConnectToBluetoothDevice(device_id); 448 delegate->ConnectToBluetoothDevice(device_id);
449 } 449 }
450 450
451 void HandleButtonPressed(views::Button* sender, 451 void HandleButtonPressed(views::Button* sender,
452 const ui::Event& event) override { 452 const ui::Event& event) override {
453 if (sender == toggle_) 453 if (sender == toggle_) {
454 WmShell::Get()->system_tray_delegate()->ToggleBluetooth(); 454 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
455 else if (sender == settings_) 455 WmShell::Get()->RecordUserMetricsAction(
456 delegate->GetBluetoothEnabled() ? UMA_STATUS_AREA_BLUETOOTH_DISABLED
457 : UMA_STATUS_AREA_BLUETOOTH_ENABLED);
458 delegate->ToggleBluetooth();
459 } else if (sender == settings_) {
456 ShowSettings(); 460 ShowSettings();
457 else 461 } else {
458 NOTREACHED(); 462 NOTREACHED();
463 }
459 } 464 }
460 465
461 void CreateExtraTitleRowButtons() override { 466 void CreateExtraTitleRowButtons() override {
462 if (login_ == LoginStatus::LOCKED) 467 if (login_ == LoginStatus::LOCKED)
463 return; 468 return;
464 469
465 DCHECK(!toggle_); 470 DCHECK(!toggle_);
466 DCHECK(!settings_); 471 DCHECK(!settings_);
467 472
468 tri_view()->SetContainerVisible(TriView::Container::END, true); 473 tri_view()->SetContainerVisible(TriView::Container::END, true);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 detailed_->Update(); 624 detailed_->Update();
620 } 625 }
621 626
622 void TrayBluetooth::OnBluetoothDiscoveringChanged() { 627 void TrayBluetooth::OnBluetoothDiscoveringChanged() {
623 if (!detailed_) 628 if (!detailed_)
624 return; 629 return;
625 detailed_->Update(); 630 detailed_->Update();
626 } 631 }
627 632
628 } // namespace ash 633 } // namespace ash
OLDNEW
« 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