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

Side by Side Diff: ash/system/date/date_default_view.cc

Issue 811283003: Clean-up of the system shutdown code paths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: alignment fixes, rebase Created 5 years, 11 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 | ash/system/tray/default_system_tray_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/date/date_default_view.h" 5 #include "ash/system/date/date_default_view.h"
6 6
7 #include "ash/metrics/user_metrics_recorder.h" 7 #include "ash/metrics/user_metrics_recorder.h"
8 #include "ash/session/session_state_delegate.h" 8 #include "ash/session/session_state_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/system/date/date_view.h" 10 #include "ash/system/date/date_view.h"
11 #include "ash/system/tray/special_popup_row.h" 11 #include "ash/system/tray/special_popup_row.h"
12 #include "ash/system/tray/system_tray_delegate.h" 12 #include "ash/system/tray/system_tray_delegate.h"
13 #include "ash/system/tray/tray_constants.h" 13 #include "ash/system/tray/tray_constants.h"
14 #include "ash/system/tray/tray_popup_header_button.h" 14 #include "ash/system/tray/tray_popup_header_button.h"
15 #include "ash/wm/lock_state_controller.h"
15 #include "grit/ash_resources.h" 16 #include "grit/ash_resources.h"
16 #include "grit/ash_strings.h" 17 #include "grit/ash_strings.h"
17 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
18 #include "ui/views/border.h" 19 #include "ui/views/border.h"
19 #include "ui/views/controls/button/button.h" 20 #include "ui/views/controls/button/button.h"
20 #include "ui/views/layout/fill_layout.h" 21 #include "ui/views/layout/fill_layout.h"
21 #include "ui/views/view.h" 22 #include "ui/views/view.h"
22 23
23 namespace { 24 namespace {
24 25
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 105
105 void DateDefaultView::ButtonPressed(views::Button* sender, 106 void DateDefaultView::ButtonPressed(views::Button* sender,
106 const ui::Event& event) { 107 const ui::Event& event) {
107 ash::Shell* shell = ash::Shell::GetInstance(); 108 ash::Shell* shell = ash::Shell::GetInstance();
108 ash::SystemTrayDelegate* tray_delegate = shell->system_tray_delegate(); 109 ash::SystemTrayDelegate* tray_delegate = shell->system_tray_delegate();
109 if (sender == help_) { 110 if (sender == help_) {
110 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_HELP); 111 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_HELP);
111 tray_delegate->ShowHelp(); 112 tray_delegate->ShowHelp();
112 } else if (sender == shutdown_) { 113 } else if (sender == shutdown_) {
113 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_SHUT_DOWN); 114 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_SHUT_DOWN);
114 tray_delegate->ShutDown(); 115 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown(
116 ash::LockStateController::POWER_OFF);
115 } else if (sender == lock_) { 117 } else if (sender == lock_) {
116 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_LOCK_SCREEN); 118 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_LOCK_SCREEN);
117 tray_delegate->RequestLockScreen(); 119 tray_delegate->RequestLockScreen();
118 } else { 120 } else {
119 NOTREACHED(); 121 NOTREACHED();
120 } 122 }
121 } 123 }
122 124
123 } // namespace ash 125 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/tray/default_system_tray_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698