Safebrowsing aura linux_redux compile fixes.
[chromium-blink-merge.git] / ash / session_state_delegate.h
blob47570ff91136e759922b1e251fa24e6657333720
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
3 // found in the LICENSE file.
5 #ifndef ASH_SESSION_STATE_DELEGATE_H_
6 #define ASH_SESSION_STATE_DELEGATE_H_
8 #include <string>
9 #include <vector>
11 #include "ash/ash_export.h"
12 #include "base/strings/string16.h"
14 namespace aura {
15 class Window;
16 } // namespace aura
18 namespace gfx {
19 class ImageSkia;
20 } // namespace gfx
22 namespace ash {
24 class SessionStateObserver;
26 // The index for the multi-profile item to use. The list is always LRU sorted
27 // So that the index #0 is the currently active user.
28 typedef int MultiProfileIndex;
30 // A list of user_id.
31 typedef std::vector<std::string> UserIdList;
33 // Delegate for checking and modifying the session state.
34 class ASH_EXPORT SessionStateDelegate {
35 public:
36 virtual ~SessionStateDelegate() {};
38 // Returns the maximum possible number of logged in users.
39 virtual int GetMaximumNumberOfLoggedInUsers() const = 0;
41 // Returns the number of signed in users. If 0 is returned, there is either
42 // no session in progress or no active user.
43 virtual int NumberOfLoggedInUsers() const = 0;
45 // Returns |true| if the session has been fully started for the active user.
46 // When a user becomes active, the profile and browser UI are not immediately
47 // available. Only once this method starts returning |true| is the browser
48 // startup complete and both profile and UI are fully available.
49 virtual bool IsActiveUserSessionStarted() const = 0;
51 // Returns true if the screen can be locked.
52 virtual bool CanLockScreen() const = 0;
54 // Returns true if the screen is currently locked.
55 virtual bool IsScreenLocked() const = 0;
57 // Returns true if the screen should be locked when the system is about to
58 // suspend.
59 virtual bool ShouldLockScreenBeforeSuspending() const = 0;
61 // Locks the screen. The locking happens asynchronously.
62 virtual void LockScreen() = 0;
64 // Unlocks the screen.
65 virtual void UnlockScreen() = 0;
67 // Returns |true| if user session blocked by some overlying UI. It can be
68 // login screen, lock screen or screen for adding users into multi-profile
69 // session.
70 virtual bool IsUserSessionBlocked() const = 0;
72 // Gets the displayed name for the user with the given |index|.
73 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|.
74 virtual const base::string16 GetUserDisplayName(
75 MultiProfileIndex index) const = 0;
77 // Gets the display email address for the user with the given |index|.
78 // The display email address might contains some periods in the email name
79 // as well as capitalized letters. For example: "Foo.Bar@mock.com".
80 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|.
81 virtual const std::string GetUserEmail(MultiProfileIndex index) const = 0;
83 // Gets the user id (sanitized email address) for the user with the given
84 // |index|. The function would return something like "foobar@mock.com".
85 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|.
86 virtual const std::string GetUserID(MultiProfileIndex index) const = 0;
88 // Gets the avatar image for the user with the given |index|.
89 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|.
90 virtual const gfx::ImageSkia& GetUserImage(MultiProfileIndex index) const = 0;
92 // Returns a list of all logged in users.
93 virtual void GetLoggedInUsers(UserIdList* users) = 0;
95 // Switches to another active user with |user_id|
96 // (if that user has already signed in).
97 virtual void SwitchActiveUser(const std::string& user_id) = 0;
99 // Switches the active user to the next user, with the same ordering as
100 // GetLoggedInUsers.
101 virtual void SwitchActiveUserToNext() = 0;
103 // Adds or removes sessions state observer.
104 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0;
105 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0;
107 // Transfers the visibility of a window to another user. Returns true when
108 // transfer was done. This could fail if the |window| belongs to no one and
109 // is therefore shown on the desktop of every user.
110 virtual bool TransferWindowToDesktopOfUser(
111 aura::Window* window,
112 ash::MultiProfileIndex index) = 0;
115 } // namespace ash
117 #endif // ASH_SESSION_STATE_DELEGATE_H_