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