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 or a system modal dialog box is shown, show only | 96 // If the screen is locked show only the currently active user. |
97 // the currently active user. | 97 if (multiprofile_index_ && session_state_delegate->IsUserSessionBlocked()) |
98 if (multiprofile_index_ && | |
99 (session_state_delegate->IsUserSessionBlocked() || | |
100 Shell::GetInstance()->IsSystemModalWindowOpen())) | |
101 return NULL; | 98 return NULL; |
102 | 99 |
103 CHECK(user_ == NULL); | 100 CHECK(user_ == NULL); |
104 | 101 |
105 int logged_in_users = session_state_delegate->NumberOfLoggedInUsers(); | 102 int logged_in_users = session_state_delegate->NumberOfLoggedInUsers(); |
106 | 103 |
107 // Do not show more UserView's then there are logged in users. | 104 // Do not show more UserView's then there are logged in users. |
108 if (multiprofile_index_ >= logged_in_users) | 105 if (multiprofile_index_ >= logged_in_users) |
109 return NULL; | 106 return NULL; |
110 | 107 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 void TrayUser::UpdateLayoutOfItem() { | 287 void TrayUser::UpdateLayoutOfItem() { |
291 RootWindowController* controller = GetRootWindowController( | 288 RootWindowController* controller = GetRootWindowController( |
292 system_tray()->GetWidget()->GetNativeWindow()->GetRootWindow()); | 289 system_tray()->GetWidget()->GetNativeWindow()->GetRootWindow()); |
293 if (controller && controller->shelf()) { | 290 if (controller && controller->shelf()) { |
294 UpdateAfterShelfAlignmentChange( | 291 UpdateAfterShelfAlignmentChange( |
295 controller->GetShelfLayoutManager()->GetAlignment()); | 292 controller->GetShelfLayoutManager()->GetAlignment()); |
296 } | 293 } |
297 } | 294 } |
298 | 295 |
299 } // namespace ash | 296 } // namespace ash |
OLD | NEW |