| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_CONSTANTS_H_ | |
| 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_CONSTANTS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <utility> | |
| 10 | |
| 11 namespace policy { | |
| 12 | |
| 13 // Constants related to the device management protocol. | |
| 14 namespace dm_protocol { | |
| 15 | |
| 16 // Name extern constants for URL query parameters. | |
| 17 extern const char kParamAgent[]; | |
| 18 extern const char kParamAppType[]; | |
| 19 extern const char kParamDeviceID[]; | |
| 20 extern const char kParamDeviceType[]; | |
| 21 extern const char kParamOAuthToken[]; | |
| 22 extern const char kParamPlatform[]; | |
| 23 extern const char kParamRequest[]; | |
| 24 extern const char kParamUserAffiliation[]; | |
| 25 | |
| 26 // String extern constants for the device and app type we report to the server. | |
| 27 extern const char kValueAppType[]; | |
| 28 extern const char kValueDeviceType[]; | |
| 29 extern const char kValueRequestAutoEnrollment[]; | |
| 30 extern const char kValueRequestPolicy[]; | |
| 31 extern const char kValueRequestRegister[]; | |
| 32 extern const char kValueRequestUnregister[]; | |
| 33 extern const char kValueUserAffiliationManaged[]; | |
| 34 extern const char kValueUserAffiliationNone[]; | |
| 35 | |
| 36 // Policy type strings for the policy_type field in PolicyFetchRequest. | |
| 37 extern const char kChromeDevicePolicyType[]; | |
| 38 extern const char kChromeUserPolicyType[]; | |
| 39 extern const char kChromePublicAccountPolicyType[]; | |
| 40 extern const char kChromeExtensionPolicyType[]; | |
| 41 | |
| 42 // These codes are sent in the |error_code| field of PolicyFetchResponse. | |
| 43 enum PolicyFetchStatus { | |
| 44 POLICY_FETCH_SUCCESS = 200, | |
| 45 POLICY_FETCH_ERROR_NOT_FOUND = 902, | |
| 46 }; | |
| 47 | |
| 48 } // namespace dm_protocol | |
| 49 | |
| 50 // Describes the affiliation of a user w.r.t. the device owner. | |
| 51 enum UserAffiliation { | |
| 52 // User is on the same domain the device was registered with. | |
| 53 USER_AFFILIATION_MANAGED, | |
| 54 // No affiliation between device and user. | |
| 55 USER_AFFILIATION_NONE, | |
| 56 }; | |
| 57 | |
| 58 // Status codes for communication errors with the device management service. | |
| 59 enum DeviceManagementStatus { | |
| 60 // All is good. | |
| 61 DM_STATUS_SUCCESS, | |
| 62 // Request payload invalid. | |
| 63 DM_STATUS_REQUEST_INVALID, | |
| 64 // The HTTP request failed. | |
| 65 DM_STATUS_REQUEST_FAILED, | |
| 66 // The server returned an error code that points to a temporary problem. | |
| 67 DM_STATUS_TEMPORARY_UNAVAILABLE, | |
| 68 // The HTTP request returned a non-success code. | |
| 69 DM_STATUS_HTTP_STATUS_ERROR, | |
| 70 // Response could not be decoded. | |
| 71 DM_STATUS_RESPONSE_DECODING_ERROR, | |
| 72 // Service error: Management not supported. | |
| 73 DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED, | |
| 74 // Service error: Device not found. | |
| 75 DM_STATUS_SERVICE_DEVICE_NOT_FOUND, | |
| 76 // Service error: Device token invalid. | |
| 77 DM_STATUS_SERVICE_MANAGEMENT_TOKEN_INVALID, | |
| 78 // Service error: Activation pending. | |
| 79 DM_STATUS_SERVICE_ACTIVATION_PENDING, | |
| 80 // Service error: The serial number is not valid or not known to the server. | |
| 81 DM_STATUS_SERVICE_INVALID_SERIAL_NUMBER, | |
| 82 // Service error: The device id used for registration is already taken. | |
| 83 DM_STATUS_SERVICE_DEVICE_ID_CONFLICT, | |
| 84 // Service error: The licenses have expired or have been exhausted. | |
| 85 DM_STATUS_SERVICE_MISSING_LICENSES, | |
| 86 // Service error: Policy not found. Error code defined by the DM folks. | |
| 87 DM_STATUS_SERVICE_POLICY_NOT_FOUND = 902, | |
| 88 }; | |
| 89 | |
| 90 // List of modes that the device can be locked into. | |
| 91 enum DeviceMode { | |
| 92 DEVICE_MODE_PENDING, // The device mode is not yet available. | |
| 93 DEVICE_MODE_NOT_SET, // The device is not yet enrolled or owned. | |
| 94 DEVICE_MODE_CONSUMER, // The device is locally owned as consumer device. | |
| 95 DEVICE_MODE_ENTERPRISE, // The device is enrolled as an enterprise device. | |
| 96 DEVICE_MODE_KIOSK, // The device is enrolled as kiosk/retail device. | |
| 97 }; | |
| 98 | |
| 99 // A pair that combines a policy fetch type and entity ID. | |
| 100 typedef std::pair<std::string, std::string> PolicyNamespaceKey; | |
| 101 | |
| 102 } // namespace policy | |
| 103 | |
| 104 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CONSTANTS_H_ | |
| OLD | NEW |