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 ASH_SESSION_STATE_DELEGATE_H_ | 5 #ifndef ASH_SESSION_STATE_DELEGATE_H_ |
6 #define ASH_SESSION_STATE_DELEGATE_H_ | 6 #define ASH_SESSION_STATE_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class ImageSkia; | 15 class ImageSkia; |
16 } // namespace gfx | 16 } // namespace gfx |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
19 | 19 |
| 20 class SessionStateObserver; |
| 21 |
20 // The index for the multi-profile item to use. The list is always LRU sorted | 22 // The index for the multi-profile item to use. The list is always LRU sorted |
21 // So that the index #0 is the currently active user. | 23 // So that the index #0 is the currently active user. |
22 typedef int MultiProfileIndex; | 24 typedef int MultiProfileIndex; |
23 | 25 |
24 // A list of email addresses. | 26 // A list of user_id. |
25 typedef std::vector<std::string> UserEmailList; | 27 typedef std::vector<std::string> UserIdList; |
26 | 28 |
27 // Delegate for checking and modifying the session state. | 29 // Delegate for checking and modifying the session state. |
28 class ASH_EXPORT SessionStateDelegate { | 30 class ASH_EXPORT SessionStateDelegate { |
29 public: | 31 public: |
30 virtual ~SessionStateDelegate() {}; | 32 virtual ~SessionStateDelegate() {}; |
31 | 33 |
32 // Returns the maximum possible number of logged in users. | 34 // Returns the maximum possible number of logged in users. |
33 virtual int GetMaximumNumberOfLoggedInUsers() const = 0; | 35 virtual int GetMaximumNumberOfLoggedInUsers() const = 0; |
34 | 36 |
35 // Returns the number of signed in users. If 0 is returned, there is either | 37 // Returns the number of signed in users. If 0 is returned, there is either |
(...skipping 25 matching lines...) Expand all Loading... |
61 | 63 |
62 // Gets the email address for the user with the given |index|. | 64 // Gets the email address for the user with the given |index|. |
63 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. | 65 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. |
64 virtual const std::string GetUserEmail(MultiProfileIndex index) const = 0; | 66 virtual const std::string GetUserEmail(MultiProfileIndex index) const = 0; |
65 | 67 |
66 // Gets the avatar image for the user with the given |index|. | 68 // Gets the avatar image for the user with the given |index|. |
67 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. | 69 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. |
68 virtual const gfx::ImageSkia& GetUserImage(MultiProfileIndex index) const = 0; | 70 virtual const gfx::ImageSkia& GetUserImage(MultiProfileIndex index) const = 0; |
69 | 71 |
70 // Returns a list of all logged in users. | 72 // Returns a list of all logged in users. |
71 virtual void GetLoggedInUsers(UserEmailList* users) = 0; | 73 virtual void GetLoggedInUsers(UserIdList* users) = 0; |
72 | 74 |
73 // Switches to another active user (if that user has already signed in). | 75 // Switches to another active user (if that user has already signed in). |
74 virtual void SwitchActiveUser(const std::string& email) = 0; | 76 virtual void SwitchActiveUser(const std::string& user_id) = 0; |
| 77 |
| 78 // Adds or removes sessions state observer. |
| 79 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0; |
| 80 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0; |
75 }; | 81 }; |
76 | 82 |
77 } // namespace ash | 83 } // namespace ash |
78 | 84 |
79 #endif // ASH_SESSION_STATE_DELEGATE_H_ | 85 #endif // ASH_SESSION_STATE_DELEGATE_H_ |
OLD | NEW |