#include "chromeos/dbus/session_manager_client.h"
#include "chromeos/tpm_token_loader.h"
#include "components/policy/core/common/cloud/cloud_policy_validator.h"
+#include "policy/proto/device_management_backend.pb.h"
namespace crypto {
class RSAPrivateKey;
namespace enterprise_management {
class ChromeDeviceSettingsProto;
-class PolicyData;
-class PolicyFetchResponse;
}
namespace chromeos {
scoped_ptr<enterprise_management::ChromeDeviceSettingsProto> new_settings,
const base::Closure& callback);
+ // Sets the management related settings in PolicyData. Note that if
+ // |management_mode| is NOT_MANAGED, |request_token| and |device_id| should be
+ // empty strings.
+ void SetManagementSettings(
+ enterprise_management::PolicyData::ManagementMode management_mode,
+ const std::string& request_token,
+ const std::string& device_id,
+ const base::Closure& callback);
+
// Stores a policy blob to session_manager. The result of the operation is
// reported through |callback|. If successful, the updated device settings are
// present in policy_data() and device_settings() when the callback runs.
SessionManagerOperation* operation,
Status status);
+ // Updates status and invokes the callback immediately.
+ void HandleError(Status status, const base::Closure& callback);
+
+ // Assembles PolicyData based on |settings| and the current |policy_data_|
+ // and |username_|.
+ scoped_ptr<enterprise_management::PolicyData> AssemblePolicy(
+ const enterprise_management::ChromeDeviceSettingsProto& settings) const;
+
+ // Returns the current management mode.
+ enterprise_management::PolicyData::ManagementMode GetManagementMode() const;
+
+ // Returns true if it is okay to transfer from the current mode to the new
+ // mode. This function should be called in SetManagementMode().
+ bool CheckManagementModeTransition(
+ enterprise_management::PolicyData::ManagementMode new_mode) const;
+
SessionManagerClient* session_manager_client_;
scoped_refptr<OwnerKeyUtil> owner_key_util_;