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() { |
161 bool userAddingRunning = | |
162 (ash::Shell::GetInstance()->session_state_delegate()->GetSessionState() == | |
163 ash::SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY); | |
164 | |
160 SetVisible(show_logout_button_in_tray_ && | 165 SetVisible(show_logout_button_in_tray_ && |
161 login_status_ != user::LOGGED_IN_NONE && | 166 login_status_ != user::LOGGED_IN_NONE && |
162 login_status_ != user::LOGGED_IN_LOCKED); | 167 login_status_ != user::LOGGED_IN_LOCKED && !userAddingRunning); |
oshima
2014/08/01 20:31:22
does secondary login screen have a sign out out bu
Roman Sorokin (ftl)
2014/08/05 13:44:09
Turned out this is button for public sessions so d
| |
163 } | 168 } |
164 | 169 |
165 } // namespace ash | 170 } // namespace ash |
OLD | NEW |