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

Unified Diff: chromeos/dbus/fake_session_manager_client.cc

Issue 14761012: Updated SessionManagerClient to use the multi-profile user policy calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added TODO Created 7 years, 7 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
« no previous file with comments | « chromeos/dbus/fake_session_manager_client.h ('k') | chromeos/dbus/mock_session_manager_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_session_manager_client.cc
diff --git a/chromeos/dbus/fake_session_manager_client.cc b/chromeos/dbus/fake_session_manager_client.cc
index 177cc115dc8dad2ff8ad6574ff11ea8993f3c2ae..166f5647b268f4b02ad724cb7b8ab2c0acffd618 100644
--- a/chromeos/dbus/fake_session_manager_client.cc
+++ b/chromeos/dbus/fake_session_manager_client.cc
@@ -75,10 +75,11 @@ void FakeSessionManagerClient::RetrieveDevicePolicy(
base::Bind(callback, device_policy_));
}
-void FakeSessionManagerClient::RetrieveUserPolicy(
+void FakeSessionManagerClient::RetrievePolicyForUser(
+ const std::string& username,
const RetrievePolicyCallback& callback) {
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, user_policy_));
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(callback, user_policies_[username]));
}
void FakeSessionManagerClient::RetrieveDeviceLocalAccountPolicy(
@@ -97,10 +98,12 @@ void FakeSessionManagerClient::StoreDevicePolicy(
FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(true));
}
-void FakeSessionManagerClient::StoreUserPolicy(
+void FakeSessionManagerClient::StorePolicyForUser(
+ const std::string& username,
const std::string& policy_blob,
+ const std::string& policy_key,
const StorePolicyCallback& callback) {
- user_policy_ = policy_blob;
+ user_policies_[username] = policy_blob;
MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, true));
}
@@ -121,12 +124,16 @@ void FakeSessionManagerClient::set_device_policy(
device_policy_ = policy_blob;
}
-const std::string& FakeSessionManagerClient::user_policy() const {
- return user_policy_;
+const std::string& FakeSessionManagerClient::user_policy(
+ const std::string& username) const {
+ std::map<std::string, std::string>::const_iterator it =
+ user_policies_.find(username);
+ return it == user_policies_.end() ? EmptyString() : it->second;
}
-void FakeSessionManagerClient::set_user_policy(const std::string& policy_blob) {
- user_policy_ = policy_blob;
+void FakeSessionManagerClient::set_user_policy(const std::string& username,
+ const std::string& policy_blob) {
+ user_policies_[username] = policy_blob;
}
const std::string& FakeSessionManagerClient::device_local_account_policy(
« no previous file with comments | « chromeos/dbus/fake_session_manager_client.h ('k') | chromeos/dbus/mock_session_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698