summaryrefslogtreecommitdiffstats
path: root/ash/session_state_delegate.h
diff options
context:
space:
mode:
authorskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-18 09:09:41 +0000
committerskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-18 09:09:41 +0000
commitc8d19f8b527b6e731cc88d89574dc9127e9a62ac (patch)
tree03f18eeb52be5315dea606cb5756ad3e32429170 /ash/session_state_delegate.h
parente519c435d39e453f532b1ba352ad2944c75895d8 (diff)
downloadchromium_src-c8d19f8b527b6e731cc88d89574dc9127e9a62ac.zip
chromium_src-c8d19f8b527b6e731cc88d89574dc9127e9a62ac.tar.gz
chromium_src-c8d19f8b527b6e731cc88d89574dc9127e9a62ac.tar.bz2
Adding new user menu section to the SystemTrayMenu & refactoring of user access
It is still not fully finished - but it is functional and might be useful for what you are doing (and already quite big as it is). Note that the functionality is controlled by the flag. What is missing? - There are no unit tests yet - The visual Drop down box to add a new user is missing. - The error message box which shows the error if there are already 3 users signed in is missing. - At the moment I have ~7 lines of test code in there which I will remove before I check in. (I need them since the multi login still does not work for me) I am not sure if you want to wait until I finish the issue - or if you'd rather want to have this to be able to rather merge early then later. I leave this up to you. If you are for the latter one, you can have at least a look at my changes and if they conflict with yours. BUG=239201 TEST=visual Review URL: https://chromiumcodereview.appspot.com/14756019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200978 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/session_state_delegate.h')
-rw-r--r--ash/session_state_delegate.h42
1 files changed, 40 insertions, 2 deletions
diff --git a/ash/session_state_delegate.h b/ash/session_state_delegate.h
index f5ee359..f5451cf 100644
--- a/ash/session_state_delegate.h
+++ b/ash/session_state_delegate.h
@@ -5,17 +5,36 @@
#ifndef ASH_SESSION_STATE_DELEGATE_H_
#define ASH_SESSION_STATE_DELEGATE_H_
+#include <string>
+#include <vector>
+
#include "ash/ash_export.h"
+#include "base/string16.h"
+
+namespace gfx {
+class ImageSkia;
+} // namespace gfx
namespace ash {
+// The index for the multi-profile item to use. The list is always LRU sorted
+// So that the index #0 is the currently active user.
+typedef int MultiProfileIndex;
+
+// A list of email addresses.
+typedef std::vector<std::string> UserEmailList;
+
// Delegate for checking and modifying the session state.
class ASH_EXPORT SessionStateDelegate {
public:
virtual ~SessionStateDelegate() {};
- // Returns |true| if a session is in progress and there is an active user.
- virtual bool HasActiveUser() const = 0;
+ // Returns the maximum possible number of logged in users.
+ virtual int GetMaximumNumberOfLoggedInUsers() const = 0;
+
+ // Returns the number of signed in users. If 0 is returned, there is either
+ // no session in progress or no active user.
+ virtual int NumberOfLoggedInUsers() const = 0;
// Returns |true| if the session has been fully started for the active user.
// When a user becomes active, the profile and browser UI are not immediately
@@ -34,6 +53,25 @@ class ASH_EXPORT SessionStateDelegate {
// Unlocks the screen.
virtual void UnlockScreen() = 0;
+
+ // Gets the displayed name for the user with the given |index|.
+ // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|.
+ virtual const base::string16 GetUserDisplayName(
+ MultiProfileIndex index) const = 0;
+
+ // Gets the email address for the user with the given |index|.
+ // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|.
+ virtual const std::string GetUserEmail(MultiProfileIndex index) const = 0;
+
+ // Gets the avatar image for the user with the given |index|.
+ // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|.
+ virtual const gfx::ImageSkia& GetUserImage(MultiProfileIndex index) const = 0;
+
+ // Returns a list of all logged in users.
+ virtual void GetLoggedInUsers(UserEmailList* users) = 0;
+
+ // Switches to another active user (if that user has already signed in).
+ virtual void SwitchActiveUser(const std::string& email) = 0;
};
} // namespace ash