| 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 #ifndef CHROME_BROWSER_UI_ASH_SESSION_CONTROLLER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_SESSION_CONTROLLER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_SESSION_CONTROLLER_CLIENT_H_ | 6 #define CHROME_BROWSER_UI_ASH_SESSION_CONTROLLER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "ash/public/interfaces/session_controller.mojom.h" | 8 #include "ash/public/interfaces/session_controller.mojom.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "components/session_manager/core/session_manager_observer.h" | 10 #include "components/session_manager/core/session_manager_observer.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 public user_manager::UserManager::UserSessionStateObserver, | 27 public user_manager::UserManager::UserSessionStateObserver, |
| 28 public user_manager::UserManager::Observer, | 28 public user_manager::UserManager::Observer, |
| 29 public session_manager::SessionManagerObserver { | 29 public session_manager::SessionManagerObserver { |
| 30 public: | 30 public: |
| 31 SessionControllerClient(); | 31 SessionControllerClient(); |
| 32 ~SessionControllerClient() override; | 32 ~SessionControllerClient() override; |
| 33 | 33 |
| 34 // ash::mojom::SessionControllerClient: | 34 // ash::mojom::SessionControllerClient: |
| 35 void RequestLockScreen() override; | 35 void RequestLockScreen() override; |
| 36 void SwitchActiveUser(const AccountId& account_id) override; | 36 void SwitchActiveUser(const AccountId& account_id) override; |
| 37 void CycleActiveUser(bool next_user) override; | 37 void CycleActiveUser(ash::CycleUser cycle_uer) override; |
| 38 | 38 |
| 39 // user_manager::UserManager::UserSessionStateObserver: | 39 // user_manager::UserManager::UserSessionStateObserver: |
| 40 void ActiveUserChanged(const user_manager::User* active_user) override; | 40 void ActiveUserChanged(const user_manager::User* active_user) override; |
| 41 void UserAddedToSession(const user_manager::User* added_user) override; | 41 void UserAddedToSession(const user_manager::User* added_user) override; |
| 42 | 42 |
| 43 // user_manager::UserManager::Observer | 43 // user_manager::UserManager::Observer |
| 44 void OnUserImageChanged(const user_manager::User& user) override; | 44 void OnUserImageChanged(const user_manager::User& user) override; |
| 45 | 45 |
| 46 // session_manager::SessionManagerObserver: | 46 // session_manager::SessionManagerObserver: |
| 47 void OnSessionStateChanged() override; | 47 void OnSessionStateChanged() override; |
| 48 | 48 |
| 49 // TODO(xiyuan): Remove after SessionStateDelegateChromeOS is gone. | 49 // TODO(xiyuan): Remove after SessionStateDelegateChromeOS is gone. |
| 50 static bool CanLockScreen(); | 50 static bool CanLockScreen(); |
| 51 static bool ShouldLockScreenAutomatically(); | 51 static bool ShouldLockScreenAutomatically(); |
| 52 static ash::AddUserSessionPolicy GetAddUserSessionPolicy(); | 52 static ash::AddUserSessionPolicy GetAddUserSessionPolicy(); |
| 53 static void DoLockScreen(); | 53 static void DoLockScreen(); |
| 54 static void DoSwitchActiveUser(const AccountId& account_id); | 54 static void DoSwitchActiveUser(const AccountId& account_id); |
| 55 static void DoCycleActiveUser(bool next_user); | 55 static void DoCycleActiveUser(ash::CycleUser cycle_user); |
| 56 | 56 |
| 57 // Flushes the mojo pipe to ash. | 57 // Flushes the mojo pipe to ash. |
| 58 static void FlushForTesting(); | 58 static void FlushForTesting(); |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 // Connects or reconnects to the |session_controller_| interface and set | 61 // Connects or reconnects to the |session_controller_| interface and set |
| 62 // this object as its client. | 62 // this object as its client. |
| 63 void ConnectToSessionControllerAndSetClient(); | 63 void ConnectToSessionControllerAndSetClient(); |
| 64 | 64 |
| 65 // Sends session info to ash. | 65 // Sends session info to ash. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 79 | 79 |
| 80 // Whether the primary user session info is sent to ash. | 80 // Whether the primary user session info is sent to ash. |
| 81 bool primary_user_session_sent_ = false; | 81 bool primary_user_session_sent_ = false; |
| 82 | 82 |
| 83 ash::mojom::SessionInfoPtr last_sent_session_info_; | 83 ash::mojom::SessionInfoPtr last_sent_session_info_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(SessionControllerClient); | 85 DISALLOW_COPY_AND_ASSIGN(SessionControllerClient); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 #endif // CHROME_BROWSER_UI_ASH_SESSION_CONTROLLER_CLIENT_H_ | 88 #endif // CHROME_BROWSER_UI_ASH_SESSION_CONTROLLER_CLIENT_H_ |
| OLD | NEW |