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/callback_forward.h" |
9 #include "base/macros.h" | 10 #include "base/macros.h" |
10 #include "components/session_manager/core/session_manager_observer.h" | 11 #include "components/session_manager/core/session_manager_observer.h" |
11 #include "components/user_manager/user_manager.h" | 12 #include "components/user_manager/user_manager.h" |
12 #include "mojo/public/cpp/bindings/binding.h" | 13 #include "mojo/public/cpp/bindings/binding.h" |
13 | 14 |
14 namespace ash { | 15 namespace ash { |
15 enum class AddUserSessionPolicy; | 16 enum class AddUserSessionPolicy; |
16 } | 17 } |
17 | 18 |
18 namespace user_manager { | 19 namespace user_manager { |
19 class User; | 20 class User; |
20 } | 21 } |
21 | 22 |
22 // Updates session state etc to ash via SessionController interface and handles | 23 // Updates session state etc to ash via SessionController interface and handles |
23 // session related calls from ash. | 24 // session related calls from ash. |
24 // TODO(xiyuan): Update when UserSessionStateObserver is gone. | 25 // TODO(xiyuan): Update when UserSessionStateObserver is gone. |
25 class SessionControllerClient | 26 class SessionControllerClient |
26 : public ash::mojom::SessionControllerClient, | 27 : public ash::mojom::SessionControllerClient, |
27 public user_manager::UserManager::UserSessionStateObserver, | 28 public user_manager::UserManager::UserSessionStateObserver, |
28 public user_manager::UserManager::Observer, | 29 public user_manager::UserManager::Observer, |
29 public session_manager::SessionManagerObserver { | 30 public session_manager::SessionManagerObserver { |
30 public: | 31 public: |
31 SessionControllerClient(); | 32 SessionControllerClient(); |
32 ~SessionControllerClient() override; | 33 ~SessionControllerClient() override; |
33 | 34 |
| 35 static SessionControllerClient* Get(); |
| 36 |
| 37 // Calls ash SessionController to run unlock animation. |
| 38 // |animation_finished_callback| will be invoked when the animation finishes. |
| 39 void RunUnlockAnimation(base::Closure animation_finished_callback); |
| 40 |
34 // ash::mojom::SessionControllerClient: | 41 // ash::mojom::SessionControllerClient: |
35 void RequestLockScreen() override; | 42 void RequestLockScreen() override; |
36 void SwitchActiveUser(const AccountId& account_id) override; | 43 void SwitchActiveUser(const AccountId& account_id) override; |
37 void CycleActiveUser(ash::CycleUserDirection direction) override; | 44 void CycleActiveUser(ash::CycleUserDirection direction) override; |
38 | 45 |
39 // user_manager::UserManager::UserSessionStateObserver: | 46 // user_manager::UserManager::UserSessionStateObserver: |
40 void ActiveUserChanged(const user_manager::User* active_user) override; | 47 void ActiveUserChanged(const user_manager::User* active_user) override; |
41 void UserAddedToSession(const user_manager::User* added_user) override; | 48 void UserAddedToSession(const user_manager::User* added_user) override; |
42 void UserChangedChildStatus(user_manager::User* user) override; | 49 void UserChangedChildStatus(user_manager::User* user) override; |
43 | 50 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 87 |
81 // Whether the primary user session info is sent to ash. | 88 // Whether the primary user session info is sent to ash. |
82 bool primary_user_session_sent_ = false; | 89 bool primary_user_session_sent_ = false; |
83 | 90 |
84 ash::mojom::SessionInfoPtr last_sent_session_info_; | 91 ash::mojom::SessionInfoPtr last_sent_session_info_; |
85 | 92 |
86 DISALLOW_COPY_AND_ASSIGN(SessionControllerClient); | 93 DISALLOW_COPY_AND_ASSIGN(SessionControllerClient); |
87 }; | 94 }; |
88 | 95 |
89 #endif // CHROME_BROWSER_UI_ASH_SESSION_CONTROLLER_CLIENT_H_ | 96 #endif // CHROME_BROWSER_UI_ASH_SESSION_CONTROLLER_CLIENT_H_ |
OLD | NEW |