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

Unified Diff: chrome/browser/ui/ash/session_state_delegate_chromeos.h

Issue 231123002: Notify about major session changes events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/session_state_delegate_chromeos.h
diff --git a/chrome/browser/ui/ash/session_state_delegate_chromeos.h b/chrome/browser/ui/ash/session_state_delegate_chromeos.h
index b6dc92222507f21fb9abf4b7b27a8c72529ffaf1..0cc81eb3d386d130307e88c11757ac22cf07221b 100644
--- a/chrome/browser/ui/ash/session_state_delegate_chromeos.h
+++ b/chrome/browser/ui/ash/session_state_delegate_chromeos.h
@@ -9,7 +9,12 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/observer_list.h"
+#include "chrome/browser/chromeos/login/user_adding_screen.h"
#include "chrome/browser/chromeos/login/user_manager.h"
+#include "chromeos/dbus/session_manager_client.h"
+#include "chromeos/login/login_state.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
namespace ash {
class SessionStateObserver;
@@ -17,7 +22,11 @@ class SessionStateObserver;
class SessionStateDelegateChromeos
: public ash::SessionStateDelegate,
- public chromeos::UserManager::UserSessionStateObserver {
+ public chromeos::LoginState::Observer,
+ public chromeos::SessionManagerClient::Observer,
+ public chromeos::UserManager::UserSessionStateObserver,
+ public chromeos::UserAddingScreen::Observer,
+ public content::NotificationObserver {
public:
SessionStateDelegateChromeos();
virtual ~SessionStateDelegateChromeos();
@@ -36,6 +45,7 @@ class SessionStateDelegateChromeos
virtual void LockScreen() OVERRIDE;
virtual void UnlockScreen() OVERRIDE;
virtual bool IsUserSessionBlocked() const OVERRIDE;
+ virtual SessionState GetSessionState() const OVERRIDE;
virtual const base::string16 GetUserDisplayName(
ash::MultiProfileIndex index) const OVERRIDE;
virtual const std::string GetUserEmail(
@@ -51,14 +61,42 @@ class SessionStateDelegateChromeos
ash::SessionStateObserver* observer) OVERRIDE;
virtual void RemoveSessionStateObserver(
ash::SessionStateObserver* observer) OVERRIDE;
- // UserManager::UserSessionStateObserver:
+
+ // chromeos::LoginState::Observer overrides.
+ virtual void LoggedInStateChanged() OVERRIDE;
+
+ // chromeos::SessionManagerClient::Observer:
+ virtual void ScreenIsLocked() OVERRIDE;
+ virtual void ScreenIsUnlocked() OVERRIDE;
+
+ // chromeos::UserManager::UserSessionStateObserver:
virtual void ActiveUserChanged(const chromeos::User* active_user) OVERRIDE;
virtual void UserAddedToSession(const chromeos::User* added_user) OVERRIDE;
+ // chromeos::UserAddingScreen::Observer:
+ virtual void OnUserAddingStarted() OVERRIDE;
+ virtual void OnUserAddingFinished() OVERRIDE;
+
+ // content::NotificationObserver:
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
private:
+ // Sets session state to |new_state|.
+ void SetSessionState(SessionState new_state);
+
+ // Notify observers about session state change.
+ void NotifySessionStateChanged();
+
+ content::NotificationRegistrar notification_registrar_;
+
// List of observers is only used on Chrome OS for now.
ObserverList<ash::SessionStateObserver> session_state_observer_list_;
+ // Session state like at login or lock screen or inside session.
+ SessionState session_state_;
+
DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateChromeos);
};

Powered by Google App Engine
This is Rietveld 408576698