| 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 CHROME_BROWSER_UI_ASH_SESSION_STATE_DELEGATE_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_SESSION_STATE_DELEGATE_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_SESSION_STATE_DELEGATE_CHROMEOS_H_ | 6 #define CHROME_BROWSER_UI_ASH_SESSION_STATE_DELEGATE_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include "ash/session/session_state_delegate.h" | 8 #include "ash/session/session_state_delegate.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 : public ash::SessionStateDelegate, | 21 : public ash::SessionStateDelegate, |
| 22 public chromeos::LoginState::Observer, | 22 public chromeos::LoginState::Observer, |
| 23 public user_manager::UserManager::UserSessionStateObserver, | 23 public user_manager::UserManager::UserSessionStateObserver, |
| 24 public chromeos::UserAddingScreen::Observer { | 24 public chromeos::UserAddingScreen::Observer { |
| 25 public: | 25 public: |
| 26 SessionStateDelegateChromeos(); | 26 SessionStateDelegateChromeos(); |
| 27 virtual ~SessionStateDelegateChromeos(); | 27 virtual ~SessionStateDelegateChromeos(); |
| 28 | 28 |
| 29 // ash::SessionStateDelegate: | 29 // ash::SessionStateDelegate: |
| 30 virtual content::BrowserContext* GetBrowserContextByIndex( | 30 virtual content::BrowserContext* GetBrowserContextByIndex( |
| 31 ash::MultiProfileIndex index) OVERRIDE; | 31 ash::MultiProfileIndex index) override; |
| 32 virtual content::BrowserContext* GetBrowserContextForWindow( | 32 virtual content::BrowserContext* GetBrowserContextForWindow( |
| 33 aura::Window* window) OVERRIDE; | 33 aura::Window* window) override; |
| 34 virtual int GetMaximumNumberOfLoggedInUsers() const OVERRIDE; | 34 virtual int GetMaximumNumberOfLoggedInUsers() const override; |
| 35 virtual int NumberOfLoggedInUsers() const OVERRIDE; | 35 virtual int NumberOfLoggedInUsers() const override; |
| 36 virtual bool CanAddUserToMultiProfile(AddUserError* error) const OVERRIDE; | 36 virtual bool CanAddUserToMultiProfile(AddUserError* error) const override; |
| 37 virtual bool IsActiveUserSessionStarted() const OVERRIDE; | 37 virtual bool IsActiveUserSessionStarted() const override; |
| 38 virtual bool CanLockScreen() const OVERRIDE; | 38 virtual bool CanLockScreen() const override; |
| 39 virtual bool IsScreenLocked() const OVERRIDE; | 39 virtual bool IsScreenLocked() const override; |
| 40 virtual bool ShouldLockScreenBeforeSuspending() const OVERRIDE; | 40 virtual bool ShouldLockScreenBeforeSuspending() const override; |
| 41 virtual void LockScreen() OVERRIDE; | 41 virtual void LockScreen() override; |
| 42 virtual void UnlockScreen() OVERRIDE; | 42 virtual void UnlockScreen() override; |
| 43 virtual bool IsUserSessionBlocked() const OVERRIDE; | 43 virtual bool IsUserSessionBlocked() const override; |
| 44 virtual SessionState GetSessionState() const OVERRIDE; | 44 virtual SessionState GetSessionState() const override; |
| 45 virtual const user_manager::UserInfo* GetUserInfo( | 45 virtual const user_manager::UserInfo* GetUserInfo( |
| 46 ash::MultiProfileIndex index) const OVERRIDE; | 46 ash::MultiProfileIndex index) const override; |
| 47 virtual const user_manager::UserInfo* GetUserInfo( | 47 virtual const user_manager::UserInfo* GetUserInfo( |
| 48 content::BrowserContext* context) const OVERRIDE; | 48 content::BrowserContext* context) const override; |
| 49 virtual bool ShouldShowAvatar(aura::Window* window) const OVERRIDE; | 49 virtual bool ShouldShowAvatar(aura::Window* window) const override; |
| 50 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; | 50 virtual void SwitchActiveUser(const std::string& user_id) override; |
| 51 virtual void CycleActiveUser(CycleUser cycle_user) OVERRIDE; | 51 virtual void CycleActiveUser(CycleUser cycle_user) override; |
| 52 virtual bool IsMultiProfileAllowedByPrimaryUserPolicy() const OVERRIDE; | 52 virtual bool IsMultiProfileAllowedByPrimaryUserPolicy() const override; |
| 53 virtual void AddSessionStateObserver( | 53 virtual void AddSessionStateObserver( |
| 54 ash::SessionStateObserver* observer) OVERRIDE; | 54 ash::SessionStateObserver* observer) override; |
| 55 virtual void RemoveSessionStateObserver( | 55 virtual void RemoveSessionStateObserver( |
| 56 ash::SessionStateObserver* observer) OVERRIDE; | 56 ash::SessionStateObserver* observer) override; |
| 57 | 57 |
| 58 // chromeos::LoginState::Observer overrides. | 58 // chromeos::LoginState::Observer overrides. |
| 59 virtual void LoggedInStateChanged() OVERRIDE; | 59 virtual void LoggedInStateChanged() override; |
| 60 | 60 |
| 61 // user_manager::UserManager::UserSessionStateObserver: | 61 // user_manager::UserManager::UserSessionStateObserver: |
| 62 virtual void ActiveUserChanged( | 62 virtual void ActiveUserChanged( |
| 63 const user_manager::User* active_user) OVERRIDE; | 63 const user_manager::User* active_user) override; |
| 64 virtual void UserAddedToSession( | 64 virtual void UserAddedToSession( |
| 65 const user_manager::User* added_user) OVERRIDE; | 65 const user_manager::User* added_user) override; |
| 66 | 66 |
| 67 // chromeos::UserAddingScreen::Observer: | 67 // chromeos::UserAddingScreen::Observer: |
| 68 virtual void OnUserAddingStarted() OVERRIDE; | 68 virtual void OnUserAddingStarted() override; |
| 69 virtual void OnUserAddingFinished() OVERRIDE; | 69 virtual void OnUserAddingFinished() override; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 // Sets session state to |new_state|. | 72 // Sets session state to |new_state|. |
| 73 // If |force| is true then |new_state| is set even if existing session | 73 // If |force| is true then |new_state| is set even if existing session |
| 74 // state is the same (used for explicit initialization). | 74 // state is the same (used for explicit initialization). |
| 75 void SetSessionState(SessionState new_state, bool force); | 75 void SetSessionState(SessionState new_state, bool force); |
| 76 | 76 |
| 77 // Notify observers about session state change. | 77 // Notify observers about session state change. |
| 78 void NotifySessionStateChanged(); | 78 void NotifySessionStateChanged(); |
| 79 | 79 |
| 80 // Switches to a new user. This call might show a dialog asking the user if he | 80 // Switches to a new user. This call might show a dialog asking the user if he |
| 81 // wants to stop desktop casting before switching. | 81 // wants to stop desktop casting before switching. |
| 82 void TryToSwitchUser(const std::string& user_id); | 82 void TryToSwitchUser(const std::string& user_id); |
| 83 | 83 |
| 84 // List of observers is only used on Chrome OS for now. | 84 // List of observers is only used on Chrome OS for now. |
| 85 ObserverList<ash::SessionStateObserver> session_state_observer_list_; | 85 ObserverList<ash::SessionStateObserver> session_state_observer_list_; |
| 86 | 86 |
| 87 // Session state (e.g. login screen vs. user session). | 87 // Session state (e.g. login screen vs. user session). |
| 88 SessionState session_state_; | 88 SessionState session_state_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateChromeos); | 90 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateChromeos); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 #endif // CHROME_BROWSER_UI_ASH_SESSION_STATE_DELEGATE_CHROMEOS_H_ | 93 #endif // CHROME_BROWSER_UI_ASH_SESSION_STATE_DELEGATE_CHROMEOS_H_ |
| OLD | NEW |