| OLD | NEW |
| 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/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" | 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" |
| 10 #include "ash/common/system/tray/hover_highlight_view.h" | 10 #include "ash/common/system/tray/hover_highlight_view.h" |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 const std::string device_id = find->second; | 530 const std::string device_id = find->second; |
| 531 if (FoundDevice(device_id, connecting_devices_, nullptr, nullptr)) | 531 if (FoundDevice(device_id, connecting_devices_, nullptr, nullptr)) |
| 532 return; | 532 return; |
| 533 | 533 |
| 534 UpdateClickedDevice(device_id, view); | 534 UpdateClickedDevice(device_id, view); |
| 535 delegate->ConnectToBluetoothDevice(device_id); | 535 delegate->ConnectToBluetoothDevice(device_id); |
| 536 } | 536 } |
| 537 | 537 |
| 538 void HandleButtonPressed(views::Button* sender, | 538 void HandleButtonPressed(views::Button* sender, |
| 539 const ui::Event& event) override { | 539 const ui::Event& event) override { |
| 540 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); |
| 540 if (UseMd()) { | 541 if (UseMd()) { |
| 541 if (sender == toggle_) | 542 if (sender == toggle_) { |
| 542 WmShell::Get()->system_tray_delegate()->ToggleBluetooth(); | 543 WmShell::Get()->RecordUserMetricsAction( |
| 543 else if (sender == settings_) | 544 delegate->GetBluetoothEnabled() |
| 545 ? UMA_STATUS_AREA_BLUETOOTH_DISABLED |
| 546 : UMA_STATUS_AREA_BLUETOOTH_ENABLED); |
| 547 delegate->ToggleBluetooth(); |
| 548 } else if (sender == settings_) { |
| 544 ShowSettings(); | 549 ShowSettings(); |
| 545 else | 550 } else { |
| 546 NOTREACHED(); | 551 NOTREACHED(); |
| 552 } |
| 547 return; | 553 return; |
| 548 } | 554 } |
| 549 | 555 |
| 550 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); | |
| 551 if (sender == toggle_bluetooth_) | 556 if (sender == toggle_bluetooth_) |
| 552 delegate->ToggleBluetooth(); | 557 delegate->ToggleBluetooth(); |
| 553 else | 558 else |
| 554 NOTREACHED(); | 559 NOTREACHED(); |
| 555 } | 560 } |
| 556 | 561 |
| 557 void CreateExtraTitleRowButtons() override { | 562 void CreateExtraTitleRowButtons() override { |
| 558 if (login_ == LoginStatus::LOCKED) | 563 if (login_ == LoginStatus::LOCKED) |
| 559 return; | 564 return; |
| 560 | 565 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 detailed_->Update(); | 768 detailed_->Update(); |
| 764 } | 769 } |
| 765 | 770 |
| 766 void TrayBluetooth::OnBluetoothDiscoveringChanged() { | 771 void TrayBluetooth::OnBluetoothDiscoveringChanged() { |
| 767 if (!detailed_) | 772 if (!detailed_) |
| 768 return; | 773 return; |
| 769 detailed_->Update(); | 774 detailed_->Update(); |
| 770 } | 775 } |
| 771 | 776 |
| 772 } // namespace ash | 777 } // namespace ash |
| OLD | NEW |