Index: chromeos/dbus/session_manager_client.h |
diff --git a/chromeos/dbus/session_manager_client.h b/chromeos/dbus/session_manager_client.h |
index 4fd4c0955ea287154ff95d2e8f4a68f2b7042058..d0e3566450d3e1ec1c3ef4deb9612e178b2eea0b 100644 |
--- a/chromeos/dbus/session_manager_client.h |
+++ b/chromeos/dbus/session_manager_client.h |
@@ -16,6 +16,10 @@ |
#include "chromeos/dbus/dbus_client.h" |
#include "chromeos/dbus/dbus_client_implementation_type.h" |
+namespace cryptohome { |
+class Identification; |
+} |
+ |
namespace chromeos { |
// SessionManagerClient is used to communicate with the session manager. |
@@ -78,7 +82,8 @@ class CHROMEOS_EXPORT SessionManagerClient : public DBusClient { |
virtual void RestartJob(const std::vector<std::string>& argv) = 0; |
// Starts the session for the user. |
- virtual void StartSession(const std::string& user_email) = 0; |
+ virtual void StartSession( |
+ const cryptohome::Identification& cryptohome_id) = 0; |
// Stops the current session. |
virtual void StopSession() = 0; |
@@ -102,19 +107,19 @@ class CHROMEOS_EXPORT SessionManagerClient : public DBusClient { |
virtual void NotifySupervisedUserCreationFinished() = 0; |
// Map that is used to describe the set of active user sessions where |key| |
- // is user_id and |value| is user_id_hash. |
- typedef std::map<std::string, std::string> ActiveSessionsMap; |
+ // is cryptohome id and |value| is user_id_hash. |
+ using ActiveSessionsMap = std::map<cryptohome::Identification, std::string>; |
// The ActiveSessionsCallback is used for the RetrieveActiveSessions() |
- // method. It receives |sessions| argument where the keys are user_ids for |
- // all users that are currently active and |success| argument which indicates |
- // whether or not the request succeded. |
+ // method. It receives |sessions| argument where the keys are cryptohome_ids |
+ // for all users that are currently active and |success| argument which |
+ // indicates whether or not the request succeded. |
typedef base::Callback<void(const ActiveSessionsMap& sessions, |
bool success)> ActiveSessionsCallback; |
// Enumerates active user sessions. Usually Chrome naturally keeps track of |
// active users when they are added into current session. When Chrome is |
- // restarted after crash by session_manager it only receives user_id and |
+ // restarted after crash by session_manager it only receives cryptohome id and |
// user_id_hash for one user. This method is used to retrieve list of all |
// active users. |
virtual void RetrieveActiveSessions( |
@@ -131,10 +136,10 @@ class CHROMEOS_EXPORT SessionManagerClient : public DBusClient { |
virtual void RetrieveDevicePolicy(const RetrievePolicyCallback& callback) = 0; |
// Fetches the user policy blob stored by the session manager for the given |
- // |username|. Upon completion of the retrieve attempt, we will call the |
+ // |cryptohome_id|. Upon completion of the retrieve attempt, we will call the |
// provided callback. |
virtual void RetrievePolicyForUser( |
- const std::string& username, |
+ const cryptohome::Identification& cryptohome_id, |
const RetrievePolicyCallback& callback) = 0; |
// Same as RetrievePolicyForUser() but blocks until a reply is received, and |
@@ -144,7 +149,7 @@ class CHROMEOS_EXPORT SessionManagerClient : public DBusClient { |
// considered acceptable (e.g. restarting the browser after a crash or after |
// a flag change). |
virtual std::string BlockingRetrievePolicyForUser( |
- const std::string& username) = 0; |
+ const cryptohome::Identification& cryptohome_id) = 0; |
// Fetches the policy blob associated with the specified device-local account |
// from session manager. |callback| is invoked up on completion. |
@@ -162,11 +167,13 @@ class CHROMEOS_EXPORT SessionManagerClient : public DBusClient { |
virtual void StoreDevicePolicy(const std::string& policy_blob, |
const StorePolicyCallback& callback) = 0; |
- // Attempts to asynchronously store |policy_blob| as user policy for the given |
- // |username|. Upon completion of the store attempt, we will call callback. |
- virtual void StorePolicyForUser(const std::string& username, |
- const std::string& policy_blob, |
- const StorePolicyCallback& callback) = 0; |
+ // Attempts to asynchronously store |policy_blob| as user policy for the |
+ // given |cryptohome_id|. Upon completion of the store attempt, we will call |
+ // callback. |
+ virtual void StorePolicyForUser( |
+ const cryptohome::Identification& cryptohome_id, |
+ const std::string& policy_blob, |
+ const StorePolicyCallback& callback) = 0; |
// Sends a request to store a policy blob for the specified device-local |
// account. The result of the operation is reported through |callback|. |
@@ -177,7 +184,7 @@ class CHROMEOS_EXPORT SessionManagerClient : public DBusClient { |
// Sets the flags to be applied next time by the session manager when Chrome |
// is restarted inside an already started session for a particular user. |
- virtual void SetFlagsForUser(const std::string& username, |
+ virtual void SetFlagsForUser(const cryptohome::Identification& cryptohome_id, |
const std::vector<std::string>& flags) = 0; |
typedef base::Callback<void(const std::vector<std::string>& state_keys)> |