| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/user/tray_user.h" | 5 #include "ash/system/user/tray_user.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <climits> | 8 #include <climits> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 } else if (add_menu_option_.get() && | 754 } else if (add_menu_option_.get() && |
| 755 sender == add_menu_option_->GetContentsView()) { | 755 sender == add_menu_option_->GetContentsView()) { |
| 756 // Let the user add another account to the session. | 756 // Let the user add another account to the session. |
| 757 ash::Shell::GetInstance()->system_tray_delegate()->ShowUserLogin(); | 757 ash::Shell::GetInstance()->system_tray_delegate()->ShowUserLogin(); |
| 758 } else { | 758 } else { |
| 759 NOTREACHED(); | 759 NOTREACHED(); |
| 760 } | 760 } |
| 761 } | 761 } |
| 762 | 762 |
| 763 void UserView::AddLogoutButton(ash::user::LoginStatus login) { | 763 void UserView::AddLogoutButton(ash::user::LoginStatus login) { |
| 764 // A user should not be able to modify logged-in state when screen is | |
| 765 // locked. | |
| 766 if (login == ash::user::LOGGED_IN_LOCKED) | |
| 767 return; | |
| 768 | |
| 769 const base::string16 title = ash::user::GetLocalizedSignOutStringForStatus( | 764 const base::string16 title = ash::user::GetLocalizedSignOutStringForStatus( |
| 770 login, true); | 765 login, true); |
| 771 TrayPopupLabelButton* logout_button = new TrayPopupLabelButton(this, title); | 766 TrayPopupLabelButton* logout_button = new TrayPopupLabelButton(this, title); |
| 772 logout_button->SetAccessibleName(title); | 767 logout_button->SetAccessibleName(title); |
| 773 logout_button_ = logout_button; | 768 logout_button_ = logout_button; |
| 774 // In public account mode, the logout button border has a custom color. | 769 // In public account mode, the logout button border has a custom color. |
| 775 if (login == ash::user::LOGGED_IN_PUBLIC) { | 770 if (login == ash::user::LOGGED_IN_PUBLIC) { |
| 776 TrayPopupLabelButtonBorder* border = | 771 TrayPopupLabelButtonBorder* border = |
| 777 static_cast<TrayPopupLabelButtonBorder*>(logout_button_->border()); | 772 static_cast<TrayPopupLabelButtonBorder*>(logout_button_->border()); |
| 778 border->SetPainter(false, views::Button::STATE_NORMAL, | 773 border->SetPainter(false, views::Button::STATE_NORMAL, |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 kUserIconLargeSize : kUserIconSize; | 1282 kUserIconLargeSize : kUserIconSize; |
| 1288 | 1283 |
| 1289 avatar_->SetImage( | 1284 avatar_->SetImage( |
| 1290 ash::Shell::GetInstance()->session_state_delegate()->GetUserImage( | 1285 ash::Shell::GetInstance()->session_state_delegate()->GetUserImage( |
| 1291 multiprofile_index_), | 1286 multiprofile_index_), |
| 1292 gfx::Size(icon_size, icon_size)); | 1287 gfx::Size(icon_size, icon_size)); |
| 1293 } | 1288 } |
| 1294 | 1289 |
| 1295 } // namespace internal | 1290 } // namespace internal |
| 1296 } // namespace ash | 1291 } // namespace ash |
| OLD | NEW |