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

Unified Diff: components/session_manager/core/session_manager.h

Issue 2510983002: session_manager: Add SessionManagerObserver interface (Closed)
Patch Set: add default ctor Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/session_manager/core/BUILD.gn ('k') | components/session_manager/core/session_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/session_manager/core/session_manager.h
diff --git a/components/session_manager/core/session_manager.h b/components/session_manager/core/session_manager.h
index 02b7589a4576908d65778cc719a7e5dde1b2e985..f2ddb202198f0b70b4688438638c2174d1a8d766 100644
--- a/components/session_manager/core/session_manager.h
+++ b/components/session_manager/core/session_manager.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/macros.h"
+#include "base/observer_list.h"
#include "components/session_manager/session_manager_export.h"
#include "components/session_manager/session_manager_types.h"
@@ -15,6 +16,8 @@ class AccountId;
namespace session_manager {
+class SessionManagerObserver;
+
class SESSION_EXPORT SessionManager {
public:
SessionManager();
@@ -46,6 +49,9 @@ class SESSION_EXPORT SessionManager {
// before the session has been started.
virtual void SessionStarted();
+ void AddObserver(SessionManagerObserver* observer);
+ void RemoveObserver(SessionManagerObserver* observer);
+
SessionState session_state() const { return session_state_; }
const std::vector<Session>& sessions() const { return sessions_; }
@@ -84,6 +90,8 @@ class SESSION_EXPORT SessionManager {
// Keeps track of user sessions.
std::vector<Session> sessions_;
+ base::ObserverList<SessionManagerObserver> observers_;
+
DISALLOW_COPY_AND_ASSIGN(SessionManager);
};
« no previous file with comments | « components/session_manager/core/BUILD.gn ('k') | components/session_manager/core/session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698