| 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 "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/session/session_state_delegate.h" | 9 #include "ash/session/session_state_delegate.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 UpdateAfterLoginStatusChange(status); | 86 UpdateAfterLoginStatusChange(status); |
| 87 return layout_view_; | 87 return layout_view_; |
| 88 } | 88 } |
| 89 | 89 |
| 90 views::View* TrayUser::CreateDefaultView(user::LoginStatus status) { | 90 views::View* TrayUser::CreateDefaultView(user::LoginStatus status) { |
| 91 if (status == user::LOGGED_IN_NONE) | 91 if (status == user::LOGGED_IN_NONE) |
| 92 return NULL; | 92 return NULL; |
| 93 const SessionStateDelegate* session_state_delegate = | 93 const SessionStateDelegate* session_state_delegate = |
| 94 Shell::GetInstance()->session_state_delegate(); | 94 Shell::GetInstance()->session_state_delegate(); |
| 95 | 95 |
| 96 // If the screen is locked show only the currently active user. | 96 // If the screen is locked or a system modal dialog box is shown, show only |
| 97 if (multiprofile_index_ && session_state_delegate->IsUserSessionBlocked()) | 97 // the currently active user. |
| 98 if (multiprofile_index_ && |
| 99 (session_state_delegate->IsUserSessionBlocked() || |
| 100 Shell::GetInstance()->IsSystemModalWindowOpen())) |
| 98 return NULL; | 101 return NULL; |
| 99 | 102 |
| 100 CHECK(user_ == NULL); | 103 CHECK(user_ == NULL); |
| 101 | 104 |
| 102 int logged_in_users = session_state_delegate->NumberOfLoggedInUsers(); | 105 int logged_in_users = session_state_delegate->NumberOfLoggedInUsers(); |
| 103 | 106 |
| 104 // Do not show more UserView's then there are logged in users. | 107 // Do not show more UserView's then there are logged in users. |
| 105 if (multiprofile_index_ >= logged_in_users) | 108 if (multiprofile_index_ >= logged_in_users) |
| 106 return NULL; | 109 return NULL; |
| 107 | 110 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 void TrayUser::UpdateLayoutOfItem() { | 290 void TrayUser::UpdateLayoutOfItem() { |
| 288 RootWindowController* controller = GetRootWindowController( | 291 RootWindowController* controller = GetRootWindowController( |
| 289 system_tray()->GetWidget()->GetNativeWindow()->GetRootWindow()); | 292 system_tray()->GetWidget()->GetNativeWindow()->GetRootWindow()); |
| 290 if (controller && controller->shelf()) { | 293 if (controller && controller->shelf()) { |
| 291 UpdateAfterShelfAlignmentChange( | 294 UpdateAfterShelfAlignmentChange( |
| 292 controller->GetShelfLayoutManager()->GetAlignment()); | 295 controller->GetShelfLayoutManager()->GetAlignment()); |
| 293 } | 296 } |
| 294 } | 297 } |
| 295 | 298 |
| 296 } // namespace ash | 299 } // namespace ash |
| OLD | NEW |