| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/system/tiles/tiles_default_view.h" | 5 #include "ash/system/tiles/tiles_default_view.h" |
| 6 | 6 |
| 7 #include "ash/metrics/user_metrics_action.h" | 7 #include "ash/metrics/user_metrics_action.h" |
| 8 #include "ash/metrics/user_metrics_recorder.h" | 8 #include "ash/metrics/user_metrics_recorder.h" |
| 9 #include "ash/resources/vector_icons/vector_icons.h" | 9 #include "ash/resources/vector_icons/vector_icons.h" |
| 10 #include "ash/session/session_controller.h" | 10 #include "ash/session/session_controller.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 DCHECK(sender); | 119 DCHECK(sender); |
| 120 if (sender == settings_button_) { | 120 if (sender == settings_button_) { |
| 121 Shell::Get()->metrics()->RecordUserMetricsAction(UMA_TRAY_SETTINGS); | 121 Shell::Get()->metrics()->RecordUserMetricsAction(UMA_TRAY_SETTINGS); |
| 122 Shell::Get()->system_tray_controller()->ShowSettings(); | 122 Shell::Get()->system_tray_controller()->ShowSettings(); |
| 123 } else if (sender == help_button_) { | 123 } else if (sender == help_button_) { |
| 124 Shell::Get()->metrics()->RecordUserMetricsAction(UMA_TRAY_HELP); | 124 Shell::Get()->metrics()->RecordUserMetricsAction(UMA_TRAY_HELP); |
| 125 Shell::Get()->system_tray_controller()->ShowHelp(); | 125 Shell::Get()->system_tray_controller()->ShowHelp(); |
| 126 } else if (NightLightController::IsFeatureEnabled() && | 126 } else if (NightLightController::IsFeatureEnabled() && |
| 127 sender == night_light_button_) { | 127 sender == night_light_button_) { |
| 128 Shell::Get()->metrics()->RecordUserMetricsAction(UMA_TRAY_NIGHT_LIGHT); | 128 Shell::Get()->metrics()->RecordUserMetricsAction(UMA_TRAY_NIGHT_LIGHT); |
| 129 Shell::Get()->night_light_controller()->Toggle(); | 129 night_light_button_->Toggle(); |
| 130 night_light_button_->Update(); | |
| 131 } else if (sender == lock_button_) { | 130 } else if (sender == lock_button_) { |
| 132 Shell::Get()->metrics()->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN); | 131 Shell::Get()->metrics()->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN); |
| 133 chromeos::DBusThreadManager::Get() | 132 chromeos::DBusThreadManager::Get() |
| 134 ->GetSessionManagerClient() | 133 ->GetSessionManagerClient() |
| 135 ->RequestLockScreen(); | 134 ->RequestLockScreen(); |
| 136 } else if (sender == power_button_) { | 135 } else if (sender == power_button_) { |
| 137 Shell::Get()->metrics()->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN); | 136 Shell::Get()->metrics()->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN); |
| 138 Shell::Get()->lock_state_controller()->RequestShutdown( | 137 Shell::Get()->lock_state_controller()->RequestShutdown( |
| 139 ShutdownReason::TRAY_SHUT_DOWN_BUTTON); | 138 ShutdownReason::TRAY_SHUT_DOWN_BUTTON); |
| 140 } | 139 } |
| 141 } | 140 } |
| 142 | 141 |
| 143 views::View* TilesDefaultView::GetHelpButtonView() const { | 142 views::View* TilesDefaultView::GetHelpButtonView() const { |
| 144 return help_button_; | 143 return help_button_; |
| 145 } | 144 } |
| 146 | 145 |
| 147 const views::CustomButton* TilesDefaultView::GetShutdownButtonViewForTest() | 146 const views::CustomButton* TilesDefaultView::GetShutdownButtonViewForTest() |
| 148 const { | 147 const { |
| 149 return power_button_; | 148 return power_button_; |
| 150 } | 149 } |
| 151 | 150 |
| 152 } // namespace ash | 151 } // namespace ash |
| OLD | NEW |