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/system/chromeos/session/logout_button_tray.h" | 5 #include "ash/system/chromeos/session/logout_button_tray.h" |
6 | 6 |
| 7 #include "ash/session/session_state_delegate.h" |
7 #include "ash/shelf/shelf_types.h" | 8 #include "ash/shelf/shelf_types.h" |
8 #include "ash/shell.h" | 9 #include "ash/shell.h" |
9 #include "ash/system/chromeos/session/logout_confirmation_controller.h" | 10 #include "ash/system/chromeos/session/logout_confirmation_controller.h" |
10 #include "ash/system/status_area_widget.h" | 11 #include "ash/system/status_area_widget.h" |
11 #include "ash/system/tray/system_tray_delegate.h" | 12 #include "ash/system/tray/system_tray_delegate.h" |
12 #include "ash/system/tray/system_tray_notifier.h" | 13 #include "ash/system/tray/system_tray_notifier.h" |
13 #include "ash/system/tray/tray_constants.h" | 14 #include "ash/system/tray/tray_constants.h" |
14 #include "ash/system/tray/tray_utils.h" | 15 #include "ash/system/tray/tray_utils.h" |
15 #include "base/logging.h" | 16 #include "base/logging.h" |
16 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 user::LoginStatus login_status) { | 151 user::LoginStatus login_status) { |
151 login_status_ = login_status; | 152 login_status_ = login_status; |
152 const base::string16 title = | 153 const base::string16 title = |
153 GetLocalizedSignOutStringForStatus(login_status, false); | 154 GetLocalizedSignOutStringForStatus(login_status, false); |
154 button_->SetText(title); | 155 button_->SetText(title); |
155 button_->SetAccessibleName(title); | 156 button_->SetAccessibleName(title); |
156 UpdateVisibility(); | 157 UpdateVisibility(); |
157 } | 158 } |
158 | 159 |
159 void LogoutButtonTray::UpdateVisibility() { | 160 void LogoutButtonTray::UpdateVisibility() { |
160 SetVisible(show_logout_button_in_tray_ && | 161 SetVisible( |
161 login_status_ != user::LOGGED_IN_NONE && | 162 show_logout_button_in_tray_ && login_status_ != user::LOGGED_IN_NONE && |
162 login_status_ != user::LOGGED_IN_LOCKED); | 163 login_status_ != user::LOGGED_IN_LOCKED && |
| 164 ash::Shell::GetInstance()->session_state_delegate()->GetSessionState() != |
| 165 ash::SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY); |
163 } | 166 } |
164 | 167 |
165 } // namespace ash | 168 } // namespace ash |
OLD | NEW |