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