| 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_controller.h" | 8 #include "ash/common/session/session_controller.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" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 if (login != LoginStatus::LOCKED) { | 82 if (login != LoginStatus::LOCKED) { |
| 83 shutdown_button_ = new TrayPopupHeaderButton( | 83 shutdown_button_ = new TrayPopupHeaderButton( |
| 84 this, IDR_AURA_UBER_TRAY_SHUTDOWN, IDR_AURA_UBER_TRAY_SHUTDOWN, | 84 this, IDR_AURA_UBER_TRAY_SHUTDOWN, IDR_AURA_UBER_TRAY_SHUTDOWN, |
| 85 IDR_AURA_UBER_TRAY_SHUTDOWN_HOVER, IDR_AURA_UBER_TRAY_SHUTDOWN_HOVER, | 85 IDR_AURA_UBER_TRAY_SHUTDOWN_HOVER, IDR_AURA_UBER_TRAY_SHUTDOWN_HOVER, |
| 86 IDS_ASH_STATUS_TRAY_SHUTDOWN); | 86 IDS_ASH_STATUS_TRAY_SHUTDOWN); |
| 87 shutdown_button_->SetTooltipText( | 87 shutdown_button_->SetTooltipText( |
| 88 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SHUTDOWN)); | 88 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SHUTDOWN)); |
| 89 view->AddViewToRowNonMd(shutdown_button_, true); | 89 view->AddViewToRowNonMd(shutdown_button_, true); |
| 90 // This object is recreated every time the menu opens. Don't bother updating | 90 // This object is recreated every time the menu opens. Don't bother updating |
| 91 // the tooltip if the shutdown policy changes while the menu is open. | 91 // the tooltip if the shutdown policy changes while the menu is open. |
| 92 bool reboot = WmShell::Get()->shutdown_controller()->reboot_on_shutdown(); | 92 bool reboot = Shell::Get()->shutdown_controller()->reboot_on_shutdown(); |
| 93 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16( | 93 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16( |
| 94 reboot ? IDS_ASH_STATUS_TRAY_REBOOT : IDS_ASH_STATUS_TRAY_SHUTDOWN)); | 94 reboot ? IDS_ASH_STATUS_TRAY_REBOOT : IDS_ASH_STATUS_TRAY_SHUTDOWN)); |
| 95 } | 95 } |
| 96 | 96 |
| 97 if (shell->session_controller()->CanLockScreen()) { | 97 if (shell->session_controller()->CanLockScreen()) { |
| 98 lock_button_ = new TrayPopupHeaderButton( | 98 lock_button_ = new TrayPopupHeaderButton( |
| 99 this, IDR_AURA_UBER_TRAY_LOCKSCREEN, IDR_AURA_UBER_TRAY_LOCKSCREEN, | 99 this, IDR_AURA_UBER_TRAY_LOCKSCREEN, IDR_AURA_UBER_TRAY_LOCKSCREEN, |
| 100 IDR_AURA_UBER_TRAY_LOCKSCREEN_HOVER, | 100 IDR_AURA_UBER_TRAY_LOCKSCREEN_HOVER, |
| 101 IDR_AURA_UBER_TRAY_LOCKSCREEN_HOVER, IDS_ASH_STATUS_TRAY_LOCK); | 101 IDR_AURA_UBER_TRAY_LOCKSCREEN_HOVER, IDS_ASH_STATUS_TRAY_LOCK); |
| 102 lock_button_->SetTooltipText( | 102 lock_button_->SetTooltipText( |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 chromeos::DBusThreadManager::Get() | 137 chromeos::DBusThreadManager::Get() |
| 138 ->GetSessionManagerClient() | 138 ->GetSessionManagerClient() |
| 139 ->RequestLockScreen(); | 139 ->RequestLockScreen(); |
| 140 } else { | 140 } else { |
| 141 NOTREACHED(); | 141 NOTREACHED(); |
| 142 } | 142 } |
| 143 date_view_->CloseSystemBubble(); | 143 date_view_->CloseSystemBubble(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace ash | 146 } // namespace ash |
| OLD | NEW |