| Index: chromeos/dbus/session_manager_client.cc
|
| diff --git a/chromeos/dbus/session_manager_client.cc b/chromeos/dbus/session_manager_client.cc
|
| index dd9c13ad6ee11acca20c7cc683093d858784c342..d2274286dc5e8bd7b9d6bf974d13d9ee26ad7032 100644
|
| --- a/chromeos/dbus/session_manager_client.cc
|
| +++ b/chromeos/dbus/session_manager_client.cc
|
| @@ -153,11 +153,11 @@ class SessionManagerClientImpl : public SessionManagerClient {
|
| false);
|
| }
|
|
|
| - void StartSession(const std::string& user_email) override {
|
| + void StartSession(const std::string& user_id) override {
|
| dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
|
| login_manager::kSessionManagerStartSession);
|
| dbus::MessageWriter writer(&method_call);
|
| - writer.AppendString(user_email);
|
| + writer.AppendString(user_id);
|
| writer.AppendString(""); // Unique ID is deprecated
|
| session_manager_proxy_->CallMethod(
|
| &method_call,
|
| @@ -238,21 +238,19 @@ class SessionManagerClientImpl : public SessionManagerClient {
|
| callback));
|
| }
|
|
|
| - void RetrievePolicyForUser(const std::string& username,
|
| + void RetrievePolicyForUser(const std::string& user_id,
|
| const RetrievePolicyCallback& callback) override {
|
| CallRetrievePolicyByUsername(
|
| - login_manager::kSessionManagerRetrievePolicyForUser,
|
| - username,
|
| - callback);
|
| + login_manager::kSessionManagerRetrievePolicyForUser, user_id, callback);
|
| }
|
|
|
| std::string BlockingRetrievePolicyForUser(
|
| - const std::string& username) override {
|
| + const std::string& user_id) override {
|
| dbus::MethodCall method_call(
|
| login_manager::kSessionManagerInterface,
|
| login_manager::kSessionManagerRetrievePolicyForUser);
|
| dbus::MessageWriter writer(&method_call);
|
| - writer.AppendString(username);
|
| + writer.AppendString(user_id);
|
| scoped_ptr<dbus::Response> response =
|
| blocking_method_caller_->CallMethodAndBlock(&method_call);
|
| std::string policy;
|
| @@ -289,13 +287,11 @@ class SessionManagerClientImpl : public SessionManagerClient {
|
| callback));
|
| }
|
|
|
| - void StorePolicyForUser(const std::string& username,
|
| + void StorePolicyForUser(const std::string& user_id,
|
| const std::string& policy_blob,
|
| const StorePolicyCallback& callback) override {
|
| CallStorePolicyByUsername(login_manager::kSessionManagerStorePolicyForUser,
|
| - username,
|
| - policy_blob,
|
| - callback);
|
| + user_id, policy_blob, callback);
|
| }
|
|
|
| void StoreDeviceLocalAccountPolicy(
|
| @@ -309,12 +305,12 @@ class SessionManagerClientImpl : public SessionManagerClient {
|
| callback);
|
| }
|
|
|
| - void SetFlagsForUser(const std::string& username,
|
| + void SetFlagsForUser(const std::string& user_id,
|
| const std::vector<std::string>& flags) override {
|
| dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
|
| login_manager::kSessionManagerSetFlagsForUser);
|
| dbus::MessageWriter writer(&method_call);
|
| - writer.AppendString(username);
|
| + writer.AppendString(user_id);
|
| writer.AppendArrayOfStrings(flags);
|
| session_manager_proxy_->CallMethod(
|
| &method_call,
|
| @@ -423,12 +419,12 @@ class SessionManagerClientImpl : public SessionManagerClient {
|
|
|
| // Helper for RetrieveDeviceLocalAccountPolicy and RetrievePolicyForUser.
|
| void CallRetrievePolicyByUsername(const std::string& method_name,
|
| - const std::string& username,
|
| + const std::string& user_id,
|
| const RetrievePolicyCallback& callback) {
|
| dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
|
| method_name);
|
| dbus::MessageWriter writer(&method_call);
|
| - writer.AppendString(username);
|
| + writer.AppendString(user_id);
|
| session_manager_proxy_->CallMethod(
|
| &method_call,
|
| dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
| @@ -440,13 +436,13 @@ class SessionManagerClientImpl : public SessionManagerClient {
|
| }
|
|
|
| void CallStorePolicyByUsername(const std::string& method_name,
|
| - const std::string& username,
|
| + const std::string& user_id,
|
| const std::string& policy_blob,
|
| const StorePolicyCallback& callback) {
|
| dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
|
| method_name);
|
| dbus::MessageWriter writer(&method_call);
|
| - writer.AppendString(username);
|
| + writer.AppendString(user_id);
|
| // static_cast does not work due to signedness.
|
| writer.AppendArrayOfBytes(
|
| reinterpret_cast<const uint8_t*>(policy_blob.data()),
|
| @@ -774,17 +770,16 @@ class SessionManagerClientStubImpl : public SessionManagerClient {
|
| base::Bind(&GetFileContent, device_policy_path),
|
| callback);
|
| }
|
| - void RetrievePolicyForUser(const std::string& username,
|
| + void RetrievePolicyForUser(const std::string& user_id,
|
| const RetrievePolicyCallback& callback) override {
|
| base::PostTaskAndReplyWithResult(
|
| - base::WorkerPool::GetTaskRunner(false).get(),
|
| - FROM_HERE,
|
| - base::Bind(&GetFileContent, GetUserFilePath(username, "stub_policy")),
|
| + base::WorkerPool::GetTaskRunner(false).get(), FROM_HERE,
|
| + base::Bind(&GetFileContent, GetUserFilePath(user_id, "stub_policy")),
|
| callback);
|
| }
|
| std::string BlockingRetrievePolicyForUser(
|
| - const std::string& username) override {
|
| - return GetFileContent(GetUserFilePath(username, "stub_policy"));
|
| + const std::string& user_id) override {
|
| + return GetFileContent(GetUserFilePath(user_id, "stub_policy"));
|
| }
|
| void RetrieveDeviceLocalAccountPolicy(
|
| const std::string& account_name,
|
| @@ -821,7 +816,7 @@ class SessionManagerClientStubImpl : public SessionManagerClient {
|
| base::Bind(callback, true),
|
| false);
|
| }
|
| - void StorePolicyForUser(const std::string& username,
|
| + void StorePolicyForUser(const std::string& user_id,
|
| const std::string& policy_blob,
|
| const StorePolicyCallback& callback) override {
|
| // The session manager writes the user policy key to a well-known
|
| @@ -834,7 +829,7 @@ class SessionManagerClientStubImpl : public SessionManagerClient {
|
| }
|
|
|
| if (response.has_new_public_key()) {
|
| - base::FilePath key_path = GetUserFilePath(username, "policy.pub");
|
| + base::FilePath key_path = GetUserFilePath(user_id, "policy.pub");
|
| base::WorkerPool::PostTask(
|
| FROM_HERE,
|
| base::Bind(&StoreFile, key_path, response.new_public_key()),
|
| @@ -843,7 +838,7 @@ class SessionManagerClientStubImpl : public SessionManagerClient {
|
|
|
| // This file isn't read directly by Chrome, but is used by this class to
|
| // reload the user policy across restarts.
|
| - base::FilePath stub_policy_path = GetUserFilePath(username, "stub_policy");
|
| + base::FilePath stub_policy_path = GetUserFilePath(user_id, "stub_policy");
|
| base::WorkerPool::PostTaskAndReply(
|
| FROM_HERE,
|
| base::Bind(&StoreFile, stub_policy_path, policy_blob),
|
| @@ -856,7 +851,7 @@ class SessionManagerClientStubImpl : public SessionManagerClient {
|
| const StorePolicyCallback& callback) override {
|
| StorePolicyForUser(account_name, policy_blob, callback);
|
| }
|
| - void SetFlagsForUser(const std::string& username,
|
| + void SetFlagsForUser(const std::string& user_id,
|
| const std::vector<std::string>& flags) override {}
|
|
|
| void GetServerBackedStateKeys(const StateKeysCallback& callback) override {
|
|
|