Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2908)

Unified Diff: ash/common/system/user/tray_user.cc

Issue 2615663002: Fix MediaClient::RequestCaptureState(). (Closed)
Patch Set: ash Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/system/user/tray_user.cc
diff --git a/ash/common/system/user/tray_user.cc b/ash/common/system/user/tray_user.cc
index 98f009e95588162ee4901b0c52f454f171d289cf..c7ebe723f2e8851fe5b0a44acff4c8bf96330295 100644
--- a/ash/common/system/user/tray_user.cc
+++ b/ash/common/system/user/tray_user.cc
@@ -5,6 +5,7 @@
#include "ash/common/system/user/tray_user.h"
#include "ash/common/material_design/material_design_controller.h"
+#include "ash/common/session/session_controller.h"
#include "ash/common/session/session_state_delegate.h"
#include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/system/tray/system_tray.h"
@@ -81,21 +82,19 @@ views::View* TrayUser::CreateTrayView(LoginStatus status) {
views::View* TrayUser::CreateDefaultView(LoginStatus status) {
if (status == LoginStatus::NOT_LOGGED_IN)
return nullptr;
- const SessionStateDelegate* session_state_delegate =
- WmShell::Get()->GetSessionStateDelegate();
+ const SessionController* session_controller =
+ WmShell::Get()->session_controller();
xiyuan 2017/01/09 21:21:47 I have an incomplete CL (replace SessionStateDeleg
// If the screen is locked or a system modal dialog box is shown, show only
// the currently active user.
- if (user_index_ && (session_state_delegate->IsUserSessionBlocked() ||
+ if (user_index_ && (session_controller->IsUserSessionBlocked() ||
WmShell::Get()->IsSystemModalWindowOpen()))
return nullptr;
CHECK(user_ == nullptr);
- int logged_in_users = session_state_delegate->NumberOfLoggedInUsers();
-
// Do not show more UserView's then there are logged in users.
- if (user_index_ >= logged_in_users)
+ if (user_index_ >= session_controller->NumberOfLoggedInUsers())
return nullptr;
user_ = new tray::UserView(this, status, user_index_);
@@ -226,11 +225,11 @@ void TrayUser::OnUserUpdate() {
}
void TrayUser::OnUserAddedToSession() {
- SessionStateDelegate* session_state_delegate =
- WmShell::Get()->GetSessionStateDelegate();
// Only create views for user items which are logged in.
- if (user_index_ >= session_state_delegate->NumberOfLoggedInUsers())
+ if (user_index_ >=
+ WmShell::Get()->session_controller()->NumberOfLoggedInUsers()) {
James Cook 2017/01/09 21:07:19 nit: line wrapping might be better here and below
riajiang 2017/01/09 23:46:50 Done.
return;
+ }
// Enforce a layout change that newly added items become visible.
UpdateLayoutOfItem();
@@ -244,8 +243,10 @@ void TrayUser::UpdateAvatarImage(LoginStatus status) {
SessionStateDelegate* session_state_delegate =
WmShell::Get()->GetSessionStateDelegate();
if (!avatar_ ||
- user_index_ >= session_state_delegate->NumberOfLoggedInUsers())
+ user_index_ >=
+ WmShell::Get()->session_controller()->NumberOfLoggedInUsers()) {
return;
+ }
const user_manager::UserInfo* user_info =
session_state_delegate->GetUserInfo(user_index_);

Powered by Google App Engine
This is Rietveld 408576698