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_state_delegate.h" | 8 #include "ash/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" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "chrome/browser/chromeos/login/user_adding_screen.h" |
12 #include "chrome/browser/chromeos/login/user_manager.h" | 13 #include "chrome/browser/chromeos/login/user_manager.h" |
13 | 14 |
14 namespace ash { | 15 namespace ash { |
15 class SessionStateObserver; | 16 class SessionStateObserver; |
16 } // namespace ash | 17 } // namespace ash |
17 | 18 |
18 class SessionStateDelegateChromeos | 19 class SessionStateDelegateChromeos |
19 : public ash::SessionStateDelegate, | 20 : public ash::SessionStateDelegate, |
20 public chromeos::UserManager::UserSessionStateObserver { | 21 public chromeos::UserManager::UserSessionStateObserver, |
| 22 public chromeos::UserAddingScreen::Observer { |
21 public: | 23 public: |
22 SessionStateDelegateChromeos(); | 24 SessionStateDelegateChromeos(); |
23 virtual ~SessionStateDelegateChromeos(); | 25 virtual ~SessionStateDelegateChromeos(); |
24 | 26 |
25 // ash::SessionStateDelegate: | 27 // ash::SessionStateDelegate: |
26 virtual content::BrowserContext* GetBrowserContextByIndex( | 28 virtual content::BrowserContext* GetBrowserContextByIndex( |
27 ash::MultiProfileIndex index) OVERRIDE; | 29 ash::MultiProfileIndex index) OVERRIDE; |
28 virtual content::BrowserContext* GetBrowserContextForWindow( | 30 virtual content::BrowserContext* GetBrowserContextForWindow( |
29 aura::Window* window) OVERRIDE; | 31 aura::Window* window) OVERRIDE; |
30 virtual int GetMaximumNumberOfLoggedInUsers() const OVERRIDE; | 32 virtual int GetMaximumNumberOfLoggedInUsers() const OVERRIDE; |
(...skipping 13 matching lines...) Expand all Loading... |
44 ash::MultiProfileIndex index) const OVERRIDE; | 46 ash::MultiProfileIndex index) const OVERRIDE; |
45 virtual const gfx::ImageSkia& GetUserImage( | 47 virtual const gfx::ImageSkia& GetUserImage( |
46 content::BrowserContext* context) const OVERRIDE; | 48 content::BrowserContext* context) const OVERRIDE; |
47 virtual bool ShouldShowAvatar(aura::Window* window) OVERRIDE; | 49 virtual bool ShouldShowAvatar(aura::Window* window) OVERRIDE; |
48 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; | 50 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; |
49 virtual void CycleActiveUser(CycleUser cycle_user) OVERRIDE; | 51 virtual void CycleActiveUser(CycleUser cycle_user) OVERRIDE; |
50 virtual void AddSessionStateObserver( | 52 virtual void AddSessionStateObserver( |
51 ash::SessionStateObserver* observer) OVERRIDE; | 53 ash::SessionStateObserver* observer) OVERRIDE; |
52 virtual void RemoveSessionStateObserver( | 54 virtual void RemoveSessionStateObserver( |
53 ash::SessionStateObserver* observer) OVERRIDE; | 55 ash::SessionStateObserver* observer) OVERRIDE; |
| 56 |
54 // UserManager::UserSessionStateObserver: | 57 // UserManager::UserSessionStateObserver: |
55 virtual void ActiveUserChanged(const chromeos::User* active_user) OVERRIDE; | 58 virtual void ActiveUserChanged(const chromeos::User* active_user) OVERRIDE; |
56 virtual void UserAddedToSession(const chromeos::User* added_user) OVERRIDE; | 59 virtual void UserAddedToSession(const chromeos::User* added_user) OVERRIDE; |
57 | 60 |
| 61 // UserAddingScreen::Observer: |
| 62 virtual void OnUserAddingStarted() OVERRIDE; |
| 63 virtual void OnUserAddingFinished() OVERRIDE; |
| 64 |
58 private: | 65 private: |
| 66 // Sets session state to |new_state|. |
| 67 void SetSessionState(SessionState new_state); |
| 68 |
| 69 // Notify observers about session state change. |
| 70 void NotifySessionStateChanged(); |
| 71 |
59 // List of observers is only used on Chrome OS for now. | 72 // List of observers is only used on Chrome OS for now. |
60 ObserverList<ash::SessionStateObserver> session_state_observer_list_; | 73 ObserverList<ash::SessionStateObserver> session_state_observer_list_; |
61 | 74 |
| 75 SessionState state_; |
| 76 |
62 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateChromeos); | 77 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateChromeos); |
63 }; | 78 }; |
64 | 79 |
65 #endif // CHROME_BROWSER_UI_ASH_SESSION_STATE_DELEGATE_CHROMEOS_H_ | 80 #endif // CHROME_BROWSER_UI_ASH_SESSION_STATE_DELEGATE_CHROMEOS_H_ |
OLD | NEW |