This source file includes following definitions.
- ForStatus
- ForRegistrationError
- ForRobotAuthFetchError
- ForRobotRefreshFetchError
- ForFetchError
- ForValidationError
- ForStoreError
- validation_status_
#include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h"
#include "net/http/http_status_code.h"
namespace policy {
EnrollmentStatus EnrollmentStatus::ForStatus(Status status) {
return EnrollmentStatus(status, DM_STATUS_SUCCESS, net::HTTP_OK,
CloudPolicyStore::STATUS_OK,
CloudPolicyValidatorBase::VALIDATION_OK);
}
EnrollmentStatus EnrollmentStatus::ForRegistrationError(
DeviceManagementStatus client_status) {
return EnrollmentStatus(STATUS_REGISTRATION_FAILED, client_status,
net::HTTP_OK, CloudPolicyStore::STATUS_OK,
CloudPolicyValidatorBase::VALIDATION_OK);
}
EnrollmentStatus EnrollmentStatus::ForRobotAuthFetchError(
DeviceManagementStatus client_status) {
return EnrollmentStatus(STATUS_ROBOT_AUTH_FETCH_FAILED, client_status,
net::HTTP_OK, CloudPolicyStore::STATUS_OK,
CloudPolicyValidatorBase::VALIDATION_OK);
}
EnrollmentStatus EnrollmentStatus::ForRobotRefreshFetchError(int http_status) {
return EnrollmentStatus(STATUS_ROBOT_REFRESH_FETCH_FAILED, DM_STATUS_SUCCESS,
http_status, CloudPolicyStore::STATUS_OK,
CloudPolicyValidatorBase::VALIDATION_OK);
}
EnrollmentStatus EnrollmentStatus::ForFetchError(
DeviceManagementStatus client_status) {
return EnrollmentStatus(STATUS_POLICY_FETCH_FAILED, client_status,
net::HTTP_OK, CloudPolicyStore::STATUS_OK,
CloudPolicyValidatorBase::VALIDATION_OK);
}
EnrollmentStatus EnrollmentStatus::ForValidationError(
CloudPolicyValidatorBase::Status validation_status) {
return EnrollmentStatus(STATUS_VALIDATION_FAILED, DM_STATUS_SUCCESS,
net::HTTP_OK, CloudPolicyStore::STATUS_OK,
validation_status);
}
EnrollmentStatus EnrollmentStatus::ForStoreError(
CloudPolicyStore::Status store_error,
CloudPolicyValidatorBase::Status validation_status) {
return EnrollmentStatus(STATUS_STORE_ERROR, DM_STATUS_SUCCESS,
net::HTTP_OK, store_error, validation_status);
}
EnrollmentStatus::EnrollmentStatus(
EnrollmentStatus::Status status,
DeviceManagementStatus client_status,
int http_status,
CloudPolicyStore::Status store_status,
CloudPolicyValidatorBase::Status validation_status)
: status_(status),
client_status_(client_status),
http_status_(http_status),
store_status_(store_status),
validation_status_(validation_status) {}
}