| OLD | NEW |
| 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/common/system/date/date_default_view.h" | 5 #include "ash/common/system/date/date_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/shutdown_controller.h" | 9 #include "ash/common/shutdown_controller.h" |
| 10 #include "ash/common/system/date/date_view.h" | 10 #include "ash/common/system/date/date_view.h" |
| 11 #include "ash/common/system/tray/special_popup_row.h" | 11 #include "ash/common/system/tray/special_popup_row.h" |
| 12 #include "ash/common/system/tray/system_tray.h" | 12 #include "ash/common/system/tray/system_tray.h" |
| 13 #include "ash/common/system/tray/system_tray_controller.h" | 13 #include "ash/common/system/tray/system_tray_controller.h" |
| 14 #include "ash/common/system/tray/tray_constants.h" | 14 #include "ash/common/system/tray/tray_constants.h" |
| 15 #include "ash/common/system/tray/tray_popup_header_button.h" | 15 #include "ash/common/system/tray/tray_popup_header_button.h" |
| 16 #include "ash/common/wm_shell.h" | 16 #include "ash/common/wm_shell.h" |
| 17 #include "ash/shell.h" |
| 18 #include "ash/wm/lock_state_controller.h" |
| 17 #include "base/i18n/rtl.h" | 19 #include "base/i18n/rtl.h" |
| 18 #include "chromeos/dbus/dbus_thread_manager.h" | 20 #include "chromeos/dbus/dbus_thread_manager.h" |
| 19 #include "chromeos/dbus/session_manager_client.h" | 21 #include "chromeos/dbus/session_manager_client.h" |
| 20 #include "grit/ash_resources.h" | 22 #include "grit/ash_resources.h" |
| 21 #include "grit/ash_strings.h" | 23 #include "grit/ash_strings.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
| 23 #include "ui/views/border.h" | 25 #include "ui/views/border.h" |
| 24 #include "ui/views/controls/button/button.h" | 26 #include "ui/views/controls/button/button.h" |
| 25 #include "ui/views/layout/fill_layout.h" | 27 #include "ui/views/layout/fill_layout.h" |
| 26 #include "ui/views/view.h" | 28 #include "ui/views/view.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 124 } |
| 123 | 125 |
| 124 void DateDefaultView::ButtonPressed(views::Button* sender, | 126 void DateDefaultView::ButtonPressed(views::Button* sender, |
| 125 const ui::Event& event) { | 127 const ui::Event& event) { |
| 126 WmShell* shell = WmShell::Get(); | 128 WmShell* shell = WmShell::Get(); |
| 127 if (sender == help_button_) { | 129 if (sender == help_button_) { |
| 128 shell->RecordUserMetricsAction(UMA_TRAY_HELP); | 130 shell->RecordUserMetricsAction(UMA_TRAY_HELP); |
| 129 shell->system_tray_controller()->ShowHelp(); | 131 shell->system_tray_controller()->ShowHelp(); |
| 130 } else if (sender == shutdown_button_) { | 132 } else if (sender == shutdown_button_) { |
| 131 shell->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN); | 133 shell->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN); |
| 132 shell->RequestShutdown(); | 134 Shell::GetInstance()->lock_state_controller()->RequestShutdown(); |
| 133 } else if (sender == lock_button_) { | 135 } else if (sender == lock_button_) { |
| 134 shell->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN); | 136 shell->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN); |
| 135 chromeos::DBusThreadManager::Get() | 137 chromeos::DBusThreadManager::Get() |
| 136 ->GetSessionManagerClient() | 138 ->GetSessionManagerClient() |
| 137 ->RequestLockScreen(); | 139 ->RequestLockScreen(); |
| 138 } else { | 140 } else { |
| 139 NOTREACHED(); | 141 NOTREACHED(); |
| 140 } | 142 } |
| 141 date_view_->CloseSystemBubble(); | 143 date_view_->CloseSystemBubble(); |
| 142 } | 144 } |
| 143 | 145 |
| 144 } // namespace ash | 146 } // namespace ash |
| OLD | NEW |