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

Side by Side Diff: ash/common/system/tiles/tiles_default_view.cc

Issue 2491403003: chromeos: Move SystemTrayDelegate::RequestShutdown to WmShell (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
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/common/system/tiles/tiles_default_view.h" 5 #include "ash/common/system/tiles/tiles_default_view.h"
6 6
7 #include "ash/common/metrics/user_metrics_action.h" 7 #include "ash/common/metrics/user_metrics_action.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/system_menu_button.h" 9 #include "ash/common/system/tray/system_menu_button.h"
10 #include "ash/common/system/tray/system_tray.h" 10 #include "ash/common/system/tray/system_tray.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 shell->system_tray_controller()->ShowHelp(); 128 shell->system_tray_controller()->ShowHelp();
129 } else if (sender == lock_button_) { 129 } else if (sender == lock_button_) {
130 shell->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN); 130 shell->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN);
131 #if defined(OS_CHROMEOS) 131 #if defined(OS_CHROMEOS)
132 chromeos::DBusThreadManager::Get() 132 chromeos::DBusThreadManager::Get()
133 ->GetSessionManagerClient() 133 ->GetSessionManagerClient()
134 ->RequestLockScreen(); 134 ->RequestLockScreen();
135 #endif 135 #endif
136 } else if (sender == power_button_) { 136 } else if (sender == power_button_) {
137 shell->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN); 137 shell->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN);
138 shell->system_tray_delegate()->RequestShutdown(); 138 shell->RequestShutdown();
139 } 139 }
140 140
141 owner_->system_tray()->CloseSystemBubble(); 141 owner_->system_tray()->CloseSystemBubble();
142 } 142 }
143 143
144 void TilesDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) { 144 void TilesDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) {
145 if (!power_button_) 145 if (!power_button_)
146 return; 146 return;
147 147
148 power_button_->SetTooltipText(l10n_util::GetStringUTF16( 148 power_button_->SetTooltipText(l10n_util::GetStringUTF16(
149 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT 149 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT
150 : IDS_ASH_STATUS_TRAY_SHUTDOWN)); 150 : IDS_ASH_STATUS_TRAY_SHUTDOWN));
151 } 151 }
152 152
153 views::View* TilesDefaultView::GetHelpButtonView() const { 153 views::View* TilesDefaultView::GetHelpButtonView() const {
154 return help_button_; 154 return help_button_;
155 } 155 }
156 156
157 const views::CustomButton* TilesDefaultView::GetShutdownButtonViewForTest() 157 const views::CustomButton* TilesDefaultView::GetShutdownButtonViewForTest()
158 const { 158 const {
159 return power_button_; 159 return power_button_;
160 } 160 }
161 161
162 } // namespace ash 162 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698