| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/session/session_controller.h" | 5 #include "ash/common/session/session_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/session/session_state_observer.h" | 9 #include "ash/common/session/session_state_observer.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 void SessionController::LockScreen() { | 66 void SessionController::LockScreen() { |
| 67 if (client_) | 67 if (client_) |
| 68 client_->RequestLockScreen(); | 68 client_->RequestLockScreen(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void SessionController::SwitchActiveUser(const AccountId& account_id) { | 71 void SessionController::SwitchActiveUser(const AccountId& account_id) { |
| 72 if (client_) | 72 if (client_) |
| 73 client_->SwitchActiveUser(account_id); | 73 client_->SwitchActiveUser(account_id); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void SessionController::CycleActiveUser(bool next_user) { | 76 void SessionController::CycleActiveUser(CycleUser cycle_user) { |
| 77 if (client_) | 77 if (client_) |
| 78 client_->CycleActiveUser(next_user); | 78 client_->CycleActiveUser(cycle_user); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void SessionController::AddSessionStateObserver( | 81 void SessionController::AddSessionStateObserver( |
| 82 SessionStateObserver* observer) { | 82 SessionStateObserver* observer) { |
| 83 observers_.AddObserver(observer); | 83 observers_.AddObserver(observer); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void SessionController::RemoveSessionStateObserver( | 86 void SessionController::RemoveSessionStateObserver( |
| 87 SessionStateObserver* observer) { | 87 SessionStateObserver* observer) { |
| 88 observers_.RemoveObserver(observer); | 88 observers_.RemoveObserver(observer); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void SessionController::AddUserSession(mojom::UserSessionPtr user_session) { | 157 void SessionController::AddUserSession(mojom::UserSessionPtr user_session) { |
| 158 const AccountId account_id(user_session->account_id); | 158 const AccountId account_id(user_session->account_id); |
| 159 | 159 |
| 160 user_sessions_.push_back(std::move(user_session)); | 160 user_sessions_.push_back(std::move(user_session)); |
| 161 | 161 |
| 162 for (auto& observer : observers_) | 162 for (auto& observer : observers_) |
| 163 observer.UserAddedToSession(account_id); | 163 observer.UserAddedToSession(account_id); |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace ash | 166 } // namespace ash |
| OLD | NEW |