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_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" |
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/resources/grit/ash_resources.h" | 17 #include "ash/resources/grit/ash_resources.h" |
18 #include "ash/shell.h" | 18 #include "ash/shell.h" |
(...skipping 29 matching lines...) Expand all Loading... |
48 | 48 |
49 date_view_ = new tray::DateView(owner); | 49 date_view_ = new tray::DateView(owner); |
50 date_view_->SetBorder(views::CreateEmptyBorder( | 50 date_view_->SetBorder(views::CreateEmptyBorder( |
51 kPaddingVertical, ash::kTrayPopupPaddingHorizontal, 0, 0)); | 51 kPaddingVertical, ash::kTrayPopupPaddingHorizontal, 0, 0)); |
52 SpecialPopupRow* view = new SpecialPopupRow(); | 52 SpecialPopupRow* view = new SpecialPopupRow(); |
53 view->SetContent(date_view_); | 53 view->SetContent(date_view_); |
54 AddChildView(view); | 54 AddChildView(view); |
55 | 55 |
56 WmShell* shell = WmShell::Get(); | 56 WmShell* shell = WmShell::Get(); |
57 const bool adding_user = | 57 const bool adding_user = |
58 shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); | 58 shell->session_controller()->IsInSecondaryLoginScreen(); |
59 | 59 |
60 if (login == LoginStatus::LOCKED || login == LoginStatus::NOT_LOGGED_IN || | 60 if (login == LoginStatus::LOCKED || login == LoginStatus::NOT_LOGGED_IN || |
61 adding_user) | 61 adding_user) |
62 return; | 62 return; |
63 | 63 |
64 date_view_->SetAction(tray::DateView::DateAction::SHOW_DATE_SETTINGS); | 64 date_view_->SetAction(tray::DateView::DateAction::SHOW_DATE_SETTINGS); |
65 | 65 |
66 help_button_ = new TrayPopupHeaderButton( | 66 help_button_ = new TrayPopupHeaderButton( |
67 this, IDR_AURA_UBER_TRAY_HELP, IDR_AURA_UBER_TRAY_HELP, | 67 this, IDR_AURA_UBER_TRAY_HELP, IDR_AURA_UBER_TRAY_HELP, |
68 IDR_AURA_UBER_TRAY_HELP_HOVER, IDR_AURA_UBER_TRAY_HELP_HOVER, | 68 IDR_AURA_UBER_TRAY_HELP_HOVER, IDR_AURA_UBER_TRAY_HELP_HOVER, |
(...skipping 18 matching lines...) Expand all Loading... |
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 = WmShell::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->GetSessionStateDelegate()->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( |
103 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_LOCK)); | 103 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_LOCK)); |
104 view->AddViewToRowNonMd(lock_button_, true); | 104 view->AddViewToRowNonMd(lock_button_, true); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
(...skipping 29 matching lines...) Expand all 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 |