diff options
author | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-14 00:12:03 +0000 |
---|---|---|
committer | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-14 00:12:03 +0000 |
commit | 5b0414f79db0d24844284aec5b00254a58cda98f (patch) | |
tree | e4503f86b834d3c583b882a6f794a46651c4f99f /chromeos/dbus/session_manager_client.h | |
parent | 159d7e3921d6fd865a5f5e2863c830ec2eeb9f43 (diff) | |
download | chromium_src-5b0414f79db0d24844284aec5b00254a58cda98f.zip chromium_src-5b0414f79db0d24844284aec5b00254a58cda98f.tar.gz chromium_src-5b0414f79db0d24844284aec5b00254a58cda98f.tar.bz2 |
Updated SessionManagerClient to use the multi-profile user policy calls.
The SessionManagerClient is used to store and retrieve the user policy blobs
to and from the session_manager over DBus. New variants of these calls have been
introduced that have an additional 'username' argument, so that user policy can
be used with multiple profiles.
This CL updates the SessionManagerClient to use the new calls, and it also
makes the SessionManagerClientStub mimic the behavior of session_manager
regarding the user policy key, so that user policy can be validated and loaded
on desktop builds.
BUG=187482,230349
TEST=User policy works as before, all tests green; user policy works with --multi-profiles, and on desktop builds with --login-manager
Review URL: https://chromiumcodereview.appspot.com/14761012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199861 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/session_manager_client.h')
-rw-r--r-- | chromeos/dbus/session_manager_client.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/chromeos/dbus/session_manager_client.h b/chromeos/dbus/session_manager_client.h index 1aa9441..64eaefa 100644 --- a/chromeos/dbus/session_manager_client.h +++ b/chromeos/dbus/session_manager_client.h @@ -89,7 +89,7 @@ class CHROMEOS_EXPORT SessionManagerClient { // Notifies that the lock screen is dismissed. virtual void NotifyLockScreenDismissed() = 0; - // Used for RetrieveDevicePolicy, RetrieveUserPolicy and + // Used for RetrieveDevicePolicy, RetrievePolicyForUser and // RetrieveDeviceLocalAccountPolicy. Takes a serialized protocol buffer as // string. Upon success, we will pass a protobuf to the callback. On // failure, we will pass "". @@ -99,10 +99,12 @@ class CHROMEOS_EXPORT SessionManagerClient { // completion of the retrieve attempt, we will call the provided callback. virtual void RetrieveDevicePolicy(const RetrievePolicyCallback& callback) = 0; - // Fetches the user policy blob stored by the session manager for the - // currently signed-in user. Upon completion of the retrieve attempt, we will - // call the provided callback. - virtual void RetrieveUserPolicy(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 + // provided callback. + virtual void RetrievePolicyForUser( + const std::string& username, + const RetrievePolicyCallback& callback) = 0; // Fetches the policy blob associated with the specified device-local account // from session manager. |callback| is invoked up on completion. @@ -110,7 +112,7 @@ class CHROMEOS_EXPORT SessionManagerClient { const std::string& account_id, const RetrievePolicyCallback& callback) = 0; - // Used for StoreDevicePolicy, StoreUserPolicy and + // Used for StoreDevicePolicy, StorePolicyForUser and // StoreDeviceLocalAccountPolicy. Takes a boolean indicating whether the // operation was successful or not. typedef base::Callback<void(bool)> StorePolicyCallback; @@ -120,11 +122,14 @@ class CHROMEOS_EXPORT SessionManagerClient { virtual void StoreDevicePolicy(const std::string& policy_blob, const StorePolicyCallback& callback) = 0; - // Attempts to asynchronously store |policy_blob| as user policy for the - // currently signed-in user. Upon completion of the store attempt, we will - // call callback. - virtual void StoreUserPolicy(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. + // The |policy_key| argument is not sent to the session manager, but is used + // by the stub implementation to enable policy validation on desktop builds. + virtual void StorePolicyForUser(const std::string& username, + const std::string& policy_blob, + const std::string& policy_key, + 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|. |