Chromium Code Reviews| Index: chrome/browser/ui/ash/session_state_delegate_chromeos.cc |
| diff --git a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc |
| index 686996a3758047317a222a2fca01b4dcc0279039..7d74868486f881088124e21f0721ce7312fb0d17 100644 |
| --- a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc |
| +++ b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc |
| @@ -34,15 +34,17 @@ |
| #include "ui/gfx/image/image_skia.h" |
| SessionStateDelegateChromeos::SessionStateDelegateChromeos() |
| - : session_state_(SESSION_STATE_LOGIN_PRIMARY) { |
| + : session_state_(session_manager::SessionState::LOGIN_PRIMARY) { |
| user_manager::UserManager::Get()->AddSessionStateObserver(this); |
| chromeos::UserAddingScreen::Get()->AddObserver(this); |
| // LoginState is not initialized in unit_tests. |
| if (chromeos::LoginState::IsInitialized()) { |
| chromeos::LoginState::Get()->AddObserver(this); |
|
stevenjb
2016/10/17 22:59:34
We might want to add a comment here that we are on
xiyuan
2016/10/17 23:17:28
Added a comment. My goal is to replace SessionStat
|
| - SetSessionState(chromeos::LoginState::Get()->IsUserLoggedIn() ? |
| - SESSION_STATE_ACTIVE : SESSION_STATE_LOGIN_PRIMARY, true); |
| + SetSessionState(chromeos::LoginState::Get()->IsUserLoggedIn() |
| + ? session_manager::SessionState::ACTIVE |
| + : session_manager::SessionState::LOGIN_PRIMARY, |
| + true); |
| } |
| } |
| @@ -133,8 +135,8 @@ bool SessionStateDelegateChromeos::IsUserSessionBlocked() const { |
| chromeos::UserAddingScreen::Get()->IsRunning(); |
| } |
| -ash::SessionStateDelegate::SessionState |
| -SessionStateDelegateChromeos::GetSessionState() const { |
| +session_manager::SessionState SessionStateDelegateChromeos::GetSessionState() |
| + const { |
| return session_state_; |
| } |
| @@ -231,8 +233,10 @@ void SessionStateDelegateChromeos::RemoveSessionStateObserver( |
| } |
| void SessionStateDelegateChromeos::LoggedInStateChanged() { |
| - SetSessionState(chromeos::LoginState::Get()->IsUserLoggedIn() ? |
| - SESSION_STATE_ACTIVE : SESSION_STATE_LOGIN_PRIMARY, false); |
| + SetSessionState(chromeos::LoginState::Get()->IsUserLoggedIn() |
| + ? session_manager::SessionState::ACTIVE |
| + : session_manager::SessionState::LOGIN_PRIMARY, |
| + false); |
| } |
| void SessionStateDelegateChromeos::ActiveUserChanged( |
| @@ -248,15 +252,16 @@ void SessionStateDelegateChromeos::UserAddedToSession( |
| } |
| void SessionStateDelegateChromeos::OnUserAddingStarted() { |
| - SetSessionState(SESSION_STATE_LOGIN_SECONDARY, false); |
| + SetSessionState(session_manager::SessionState::LOGIN_SECONDARY, false); |
| } |
| void SessionStateDelegateChromeos::OnUserAddingFinished() { |
| - SetSessionState(SESSION_STATE_ACTIVE, false); |
| + SetSessionState(session_manager::SessionState::ACTIVE, false); |
| } |
| -void SessionStateDelegateChromeos::SetSessionState(SessionState new_state, |
| - bool force) { |
| +void SessionStateDelegateChromeos::SetSessionState( |
| + session_manager::SessionState new_state, |
| + bool force) { |
| if (session_state_ == new_state && !force) |
| return; |