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

Unified Diff: ash/session_state_delegate.h

Issue 14756019: Adding new user menu section to the SystemTrayMenu & refactoring of user access (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More windows breakages addressed Created 7 years, 7 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
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ash/session_state_delegate_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/session_state_delegate.h
diff --git a/ash/session_state_delegate.h b/ash/session_state_delegate.h
index f5ee359667597ff975afbecbf3742e90d256a845..f5451cff48e1fd61d5a6297e8775521b3aaac38a 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;
bartfab (slow) 2013/05/21 09:26:01 Ugh. I was added as a reviewer but then the CL was
Mr4D (OOO till 08-26) 2013/05/21 15:48:44 This function is needed by the UI in order to show
+
+ // 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
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ash/session_state_delegate_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698