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

Unified Diff: ash/session/session_controller.cc

Issue 2911493002: cros: Pull user info from session_controller_client.mojom into separate mojom. (Closed)
Patch Set: Fix ordering in typemaps Created 3 years, 7 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
« no previous file with comments | « ash/public/interfaces/user_info_traits.h ('k') | ash/session/session_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/session/session_controller.cc
diff --git a/ash/session/session_controller.cc b/ash/session/session_controller.cc
index b2f3092b9e14fb49e21df9517e2d34c5bb915fda..20d884a368939adabc0c910d8ea82529881dd2f6 100644
--- a/ash/session/session_controller.cc
+++ b/ash/session/session_controller.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <utility>
+#include "ash/public/interfaces/user_info.mojom.h"
#include "ash/session/session_observer.h"
#include "ash/shell.h"
#include "ash/system/power/power_event_observer.h"
@@ -139,7 +140,7 @@ bool SessionController::IsUserSupervised() const {
if (!IsActiveUserSessionStarted())
return false;
- user_manager::UserType active_user_type = GetUserSession(0)->type;
+ user_manager::UserType active_user_type = GetUserSession(0)->user_info->type;
return active_user_type == user_manager::USER_TYPE_SUPERVISED ||
active_user_type == user_manager::USER_TYPE_CHILD;
}
@@ -148,7 +149,7 @@ bool SessionController::IsUserChild() const {
if (!IsActiveUserSessionStarted())
return false;
- user_manager::UserType active_user_type = GetUserSession(0)->type;
+ user_manager::UserType active_user_type = GetUserSession(0)->user_info->type;
return active_user_type == user_manager::USER_TYPE_CHILD;
}
@@ -156,7 +157,7 @@ bool SessionController::IsKioskSession() const {
if (!IsActiveUserSessionStarted())
return false;
- user_manager::UserType active_user_type = GetUserSession(0)->type;
+ user_manager::UserType active_user_type = GetUserSession(0)->user_info->type;
return active_user_type == user_manager::USER_TYPE_KIOSK_APP ||
active_user_type == user_manager::USER_TYPE_ARC_KIOSK_APP;
}
@@ -208,7 +209,7 @@ void SessionController::UpdateUserSession(mojom::UserSessionPtr user_session) {
*it = std::move(user_session);
for (auto& observer : observers_)
- observer.OnUserSessionUpdated((*it)->account_id);
+ observer.OnUserSessionUpdated((*it)->user_info->account_id);
UpdateLoginStatus();
}
@@ -238,8 +239,10 @@ void SessionController::SetUserSessionOrder(
if (user_sessions_[0]->session_id != active_session_id_) {
active_session_id_ = user_sessions_[0]->session_id;
- for (auto& observer : observers_)
- observer.OnActiveUserSessionChanged(user_sessions_[0]->account_id);
+ for (auto& observer : observers_) {
+ observer.OnActiveUserSessionChanged(
+ user_sessions_[0]->user_info->account_id);
+ }
UpdateLoginStatus();
}
@@ -312,7 +315,7 @@ void SessionController::SetSessionState(SessionState state) {
}
void SessionController::AddUserSession(mojom::UserSessionPtr user_session) {
- const AccountId account_id(user_session->account_id);
+ const AccountId account_id(user_session->user_info->account_id);
user_sessions_.push_back(std::move(user_session));
@@ -350,7 +353,7 @@ LoginStatus SessionController::CalculateLoginStatusForActiveSession() const {
if (user_sessions_.empty()) // Can be empty in tests.
return LoginStatus::USER;
- switch (user_sessions_[0]->type) {
+ switch (user_sessions_[0]->user_info->type) {
case user_manager::USER_TYPE_REGULAR:
// TODO: This needs to distinguish between owner and non-owner.
return LoginStatus::USER;
« no previous file with comments | « ash/public/interfaces/user_info_traits.h ('k') | ash/session/session_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698