OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 ASH_COMMON_SESSION_SESSION_STATE_OBSERVER_H_ | 5 #ifndef ASH_COMMON_SESSION_SESSION_STATE_OBSERVER_H_ |
6 #define ASH_COMMON_SESSION_SESSION_STATE_OBSERVER_H_ | 6 #define ASH_COMMON_SESSION_SESSION_STATE_OBSERVER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "components/session_manager/session_manager_types.h" | 10 #include "components/session_manager/session_manager_types.h" |
11 | 11 |
12 class AccountId; | 12 class AccountId; |
13 | 13 |
14 namespace ash { | 14 namespace ash { |
15 | 15 |
16 class ASH_EXPORT SessionStateObserver { | 16 class ASH_EXPORT SessionStateObserver { |
17 public: | 17 public: |
18 // Called when active user has changed. | 18 // Called when active user has changed. |
19 virtual void ActiveUserChanged(const AccountId& account_id) {} | 19 virtual void ActiveUserChanged(const AccountId& account_id) {} |
20 | 20 |
21 // Called when another user gets added to the existing session. | 21 // Called when another user gets added to the existing session. |
22 virtual void UserAddedToSession(const AccountId& account_id) {} | 22 virtual void UserAddedToSession(const AccountId& account_id) {} |
23 | 23 |
| 24 // Called when a user session is updated, such as avatar change. |
| 25 virtual void UserSessionUpdated(const AccountId& account_id) {} |
| 26 |
24 // Called when session state is changed. | 27 // Called when session state is changed. |
25 virtual void SessionStateChanged(session_manager::SessionState state) {} | 28 virtual void SessionStateChanged(session_manager::SessionState state) {} |
26 | 29 |
27 protected: | 30 protected: |
28 virtual ~SessionStateObserver() {} | 31 virtual ~SessionStateObserver() {} |
29 }; | 32 }; |
30 | 33 |
31 // A class to attach / detach an object as a session state observer. | 34 // A class to attach / detach an object as a session state observer. |
32 class ASH_EXPORT ScopedSessionStateObserver { | 35 class ASH_EXPORT ScopedSessionStateObserver { |
33 public: | 36 public: |
34 explicit ScopedSessionStateObserver(SessionStateObserver* observer); | 37 explicit ScopedSessionStateObserver(SessionStateObserver* observer); |
35 virtual ~ScopedSessionStateObserver(); | 38 virtual ~ScopedSessionStateObserver(); |
36 | 39 |
37 private: | 40 private: |
38 ash::SessionStateObserver* observer_; | 41 ash::SessionStateObserver* observer_; |
39 | 42 |
40 DISALLOW_COPY_AND_ASSIGN(ScopedSessionStateObserver); | 43 DISALLOW_COPY_AND_ASSIGN(ScopedSessionStateObserver); |
41 }; | 44 }; |
42 | 45 |
43 } // namespace ash | 46 } // namespace ash |
44 | 47 |
45 #endif // ASH_COMMON_SESSION_SESSION_STATE_OBSERVER_H_ | 48 #endif // ASH_COMMON_SESSION_SESSION_STATE_OBSERVER_H_ |
OLD | NEW |