Chromium Code Reviews| 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> | |
| 9 #include <vector> | |
| 10 | |
| 8 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "base/string16.h" | |
| 13 | |
| 14 namespace gfx { | |
| 15 class ImageSkia; | |
| 16 } // namespace gfx | |
| 9 | 17 |
| 10 namespace ash { | 18 namespace ash { |
| 11 | 19 |
| 20 // 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. | |
| 22 typedef int MultiProfileIndex; | |
| 23 | |
| 24 // A list of eMail addresses. | |
|
James Cook
2013/05/17 14:03:25
nit: email (or e-mail, but http://grammarist.com/s
Mr4D (OOO till 08-26)
2013/05/17 16:26:40
Done.
Nikita (slow)
2013/05/17 17:00:31
We've decided to use user_id instead of email wher
Nikita (slow)
2013/05/21 09:57:37
Some of my comments from these files seems not hav
Mr4D (OOO till 08-26)
2013/05/21 15:48:43
Which one? I commented on every one and the email
Mr4D (OOO till 08-26)
2013/05/21 15:48:43
I have two reasons why I would not be in favor of
| |
| 25 typedef std::vector<std::string> UserEmailList; | |
| 26 | |
| 12 // Delegate for checking and modifying the session state. | 27 // Delegate for checking and modifying the session state. |
| 13 class ASH_EXPORT SessionStateDelegate { | 28 class ASH_EXPORT SessionStateDelegate { |
| 14 public: | 29 public: |
| 15 virtual ~SessionStateDelegate() {}; | 30 virtual ~SessionStateDelegate() {}; |
| 16 | 31 |
| 17 // Returns |true| if a session is in progress and there is an active user. | 32 // Returns the number of signed in users. If 0 is returned, there is either |
| 18 virtual bool HasActiveUser() const = 0; | 33 // no session in progress or no active user. |
|
Nikita (slow)
2013/05/17 17:00:31
This is a bit confusing comment because IsActiveUs
Mr4D (OOO till 08-26)
2013/05/21 15:48:43
I looked at the code and it appeared to me that th
| |
| 34 virtual int NumberOfLoggedInUsers() const = 0; | |
| 19 | 35 |
| 20 // Returns |true| if the session has been fully started for the active user. | 36 // Returns |true| if the session has been fully started for the active user. |
| 21 // When a user becomes active, the profile and browser UI are not immediately | 37 // When a user becomes active, the profile and browser UI are not immediately |
| 22 // available. Only once this method starts returning |true| is the browser | 38 // available. Only once this method starts returning |true| is the browser |
| 23 // startup complete and both profile and UI are fully available. | 39 // startup complete and both profile and UI are fully available. |
| 24 virtual bool IsActiveUserSessionStarted() const = 0; | 40 virtual bool IsActiveUserSessionStarted() const = 0; |
| 25 | 41 |
| 26 // Returns true if the screen can be locked. | 42 // Returns true if the screen can be locked. |
| 27 virtual bool CanLockScreen() const = 0; | 43 virtual bool CanLockScreen() const = 0; |
| 28 | 44 |
| 29 // Returns true if the screen is currently locked. | 45 // Returns true if the screen is currently locked. |
| 30 virtual bool IsScreenLocked() const = 0; | 46 virtual bool IsScreenLocked() const = 0; |
| 31 | 47 |
| 32 // Locks the screen. The locking happens asynchronously. | 48 // Locks the screen. The locking happens asynchronously. |
| 33 virtual void LockScreen() = 0; | 49 virtual void LockScreen() = 0; |
| 34 | 50 |
| 35 // Unlocks the screen. | 51 // Unlocks the screen. |
| 36 virtual void UnlockScreen() = 0; | 52 virtual void UnlockScreen() = 0; |
| 53 | |
| 54 // Gets the displayed name for the user with the given |index|. | |
| 55 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. | |
| 56 virtual const base::string16 GetUserDisplayName( | |
| 57 MultiProfileIndex index) const = 0; | |
| 58 | |
| 59 // Gets the email address for the user with the given |index|. | |
| 60 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. | |
| 61 virtual const std::string GetUserEmail(MultiProfileIndex index) const = 0; | |
| 62 | |
| 63 // Gets the avatar image for the user with the given |index|. | |
| 64 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. | |
| 65 virtual const gfx::ImageSkia& GetUserImage(MultiProfileIndex index) const = 0; | |
| 66 | |
| 67 // Returns a list of all logged in users. | |
| 68 virtual void GetLoggedInUsers(UserEmailList* users) = 0; | |
|
James Cook
2013/05/17 14:03:25
I suggest just returning an instance of UserEmailL
Mr4D (OOO till 08-26)
2013/05/17 16:26:40
As discussed I keep it the way it is.
| |
| 69 | |
| 70 // Switches to another active user (if that user has already signed in). | |
| 71 virtual void SwitchActiveUser(const std::string& email) = 0; | |
| 37 }; | 72 }; |
| 38 | 73 |
| 39 } // namespace ash | 74 } // namespace ash |
| 40 | 75 |
| 41 #endif // ASH_SESSION_STATE_DELEGATE_H_ | 76 #endif // ASH_SESSION_STATE_DELEGATE_H_ |
| OLD | NEW |