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

Unified Diff: chromeos/dbus/session_manager_client.h

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
Index: chromeos/dbus/session_manager_client.h
diff --git a/chromeos/dbus/session_manager_client.h b/chromeos/dbus/session_manager_client.h
index 254e762d8e988bbe03de793a0268a2fa70424f33..32f1d659780d1c2724d517e8b4b299f0c6b93917 100644
--- a/chromeos/dbus/session_manager_client.h
+++ b/chromeos/dbus/session_manager_client.h
@@ -15,6 +15,10 @@
#include "chromeos/dbus/dbus_client.h"
#include "chromeos/dbus/dbus_client_implementation_type.h"
+namespace user_manager {
+class UserID;
+}
+
namespace chromeos {
// SessionManagerClient is used to communicate with the session manager.
@@ -77,7 +81,7 @@ class CHROMEOS_EXPORT SessionManagerClient : public DBusClient {
virtual void RestartJob(int pid, const std::string& command_line) = 0;
// Starts the session for the user.
- virtual void StartSession(const std::string& user_email) = 0;
+ virtual void StartSession(const user_manager::UserID& user_id) = 0;
// Stops the current session.
virtual void StopSession() = 0;
@@ -102,7 +106,7 @@ class CHROMEOS_EXPORT SessionManagerClient : public DBusClient {
// 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;
+ typedef std::map<user_manager::UserID, std::string> ActiveSessionsMap;
// The ActiveSessionsCallback is used for the RetrieveActiveSessions()
// method. It receives |sessions| argument where the keys are user_ids for
@@ -130,10 +134,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
+ // |user_id|. Upon completion of the retrieve attempt, we will call the
// provided callback.
virtual void RetrievePolicyForUser(
- const std::string& username,
+ const user_manager::UserID& user_id,
const RetrievePolicyCallback& callback) = 0;
// Same as RetrievePolicyForUser() but blocks until a reply is received, and
@@ -143,7 +147,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 user_manager::UserID& user_id) = 0;
// Fetches the policy blob associated with the specified device-local account
// from session manager. |callback| is invoked up on completion.
@@ -162,8 +166,8 @@ class CHROMEOS_EXPORT SessionManagerClient : public DBusClient {
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,
+ // |user_id|. Upon completion of the store attempt, we will call callback.
+ virtual void StorePolicyForUser(const user_manager::UserID& user_id,
const std::string& policy_blob,
const StorePolicyCallback& callback) = 0;
@@ -176,7 +180,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 user_manager::UserID& user_id,
const std::vector<std::string>& flags) = 0;
typedef base::Callback<void(const std::vector<std::string>& state_keys)>

Powered by Google App Engine
This is Rietveld 408576698