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

Unified Diff: ash/common/session/session_controller.cc

Issue 2617763003: Add a mojo interface for AccountId (Closed)
Patch Set: rebase 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
« no previous file with comments | « no previous file | ash/common/session/session_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/session/session_controller.cc
diff --git a/ash/common/session/session_controller.cc b/ash/common/session/session_controller.cc
index 0a1c87583bef9af8872486cbe4313915e37e1a29..7df95c94f45cd30d7fa43b3ae7804b1882964807 100644
--- a/ash/common/session/session_controller.cc
+++ b/ash/common/session/session_controller.cc
@@ -70,7 +70,7 @@ void SessionController::LockScreen() {
void SessionController::SwitchActiveUser(const AccountId& account_id) {
if (client_)
- client_->SwitchActiveUser(account_id.Serialize());
+ client_->SwitchActiveUser(account_id);
}
void SessionController::CycleActiveUser(bool next_user) {
@@ -141,12 +141,8 @@ void SessionController::SetUserSessionOrder(
if (user_sessions_[0]->session_id != active_session_id_) {
active_session_id_ = user_sessions_[0]->session_id;
- AccountId account_id(EmptyAccountId());
- if (AccountId::Deserialize(user_sessions_[0]->serialized_account_id,
- &account_id)) {
- for (auto& observer : observers_)
- observer.ActiveUserChanged(account_id);
- }
+ for (auto& observer : observers_)
+ observer.ActiveUserChanged(user_sessions_[0]->account_id);
}
}
@@ -160,12 +156,7 @@ void SessionController::SetSessionState(session_manager::SessionState state) {
}
void SessionController::AddUserSession(mojom::UserSessionPtr user_session) {
- AccountId account_id(EmptyAccountId());
- if (!AccountId::Deserialize(user_session->serialized_account_id,
- &account_id)) {
- LOG(ERROR) << "Failed to deserialize account id.";
- return;
- }
+ const AccountId account_id(user_session->account_id);
user_sessions_.push_back(std::move(user_session));
« no previous file with comments | « no previous file | ash/common/session/session_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698