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

Side by Side Diff: chrome/browser/ui/ash/session_controller_client.h

Issue 2619653002: ash: SessionControllerClient observes user image change (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 unified diff | Download patch
OLDNEW
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"
11 #include "components/user_manager/user_manager.h" 11 #include "components/user_manager/user_manager.h"
12 #include "mojo/public/cpp/bindings/binding.h" 12 #include "mojo/public/cpp/bindings/binding.h"
13 13
14 namespace ash { 14 namespace ash {
15 enum class AddUserSessionPolicy; 15 enum class AddUserSessionPolicy;
16 } 16 }
17 17
18 namespace user_manager { 18 namespace user_manager {
19 class User; 19 class User;
20 } 20 }
21 21
22 // Updates session state etc to ash via SessionController interface and handles 22 // Updates session state etc to ash via SessionController interface and handles
23 // session related calls from ash. 23 // session related calls from ash.
24 // TODO(xiyuan): Update when UserSessionStateObserver is gone. 24 // TODO(xiyuan): Update when UserSessionStateObserver is gone.
25 class SessionControllerClient 25 class SessionControllerClient
26 : public ash::mojom::SessionControllerClient, 26 : public ash::mojom::SessionControllerClient,
27 public user_manager::UserManager::UserSessionStateObserver, 27 public user_manager::UserManager::UserSessionStateObserver,
28 public user_manager::UserManager::Observer,
28 public session_manager::SessionManagerObserver { 29 public session_manager::SessionManagerObserver {
29 public: 30 public:
30 SessionControllerClient(); 31 SessionControllerClient();
31 ~SessionControllerClient() override; 32 ~SessionControllerClient() override;
32 33
33 // ash::mojom::SessionControllerClient: 34 // ash::mojom::SessionControllerClient:
34 void RequestLockScreen() override; 35 void RequestLockScreen() override;
35 void SwitchActiveUser(const AccountId& account_id) override; 36 void SwitchActiveUser(const AccountId& account_id) override;
36 void CycleActiveUser(bool next_user) override; 37 void CycleActiveUser(bool next_user) override;
37 38
38 // user_manager::UserManager::UserSessionStateObserver: 39 // user_manager::UserManager::UserSessionStateObserver:
39 void ActiveUserChanged(const user_manager::User* active_user) override; 40 void ActiveUserChanged(const user_manager::User* active_user) override;
40 void UserAddedToSession(const user_manager::User* added_user) override; 41 void UserAddedToSession(const user_manager::User* added_user) override;
41 42
43 // user_manager::UserManager::Observer
44 void OnUserImageChanged(const user_manager::User& user) override;
45
42 // session_manager::SessionManagerObserver: 46 // session_manager::SessionManagerObserver:
43 void OnSessionStateChanged() override; 47 void OnSessionStateChanged() override;
44 48
45 // TODO(xiyuan): Remove after SessionStateDelegateChromeOS is gone. 49 // TODO(xiyuan): Remove after SessionStateDelegateChromeOS is gone.
46 static bool CanLockScreen(); 50 static bool CanLockScreen();
47 static bool ShouldLockScreenAutomatically(); 51 static bool ShouldLockScreenAutomatically();
48 static ash::AddUserSessionPolicy GetAddUserSessionPolicy(); 52 static ash::AddUserSessionPolicy GetAddUserSessionPolicy();
49 static void DoLockScreen(); 53 static void DoLockScreen();
50 static void DoSwitchActiveUser(const AccountId& account_id); 54 static void DoSwitchActiveUser(const AccountId& account_id);
51 static void DoCycleActiveUser(bool next_user); 55 static void DoCycleActiveUser(bool next_user);
(...skipping 23 matching lines...) Expand all
75 79
76 // Whether the primary user session info is sent to ash. 80 // Whether the primary user session info is sent to ash.
77 bool primary_user_session_sent_ = false; 81 bool primary_user_session_sent_ = false;
78 82
79 ash::mojom::SessionInfoPtr last_sent_session_info_; 83 ash::mojom::SessionInfoPtr last_sent_session_info_;
80 84
81 DISALLOW_COPY_AND_ASSIGN(SessionControllerClient); 85 DISALLOW_COPY_AND_ASSIGN(SessionControllerClient);
82 }; 86 };
83 87
84 #endif // CHROME_BROWSER_UI_ASH_SESSION_CONTROLLER_CLIENT_H_ 88 #endif // CHROME_BROWSER_UI_ASH_SESSION_CONTROLLER_CLIENT_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_new_window_client_browsertest.cc ('k') | chrome/browser/ui/ash/session_controller_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698