1 // Copyright 2019 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BASE_ENTERPRISE_UTIL_H_
6 #define BASE_ENTERPRISE_UTIL_H_
8 #include "base/base_export.h"
9 #include "build/build_config.h"
13 // Returns true if an outside entity manages the current machine. To be
14 // "managed" means that an entity such as a company or school is applying
15 // policies to this device. This is primarily checking the device for MDM
17 // Not all managed devices are enterprise devices, as BYOD (bring your own
18 // device) is becoming more common in connection with workplace joining of
19 // personal computers.
20 BASE_EXPORT bool IsManagedDevice();
22 // Returns true if the device should be considered an enterprise device. To be
23 // an enterprise device means that the enterprise actually owns or has complete
24 // control over a device. This is primarily checking if the device is joined to
26 // Not all enterprise devices are managed devices because not all enterprises
27 // actually apply policies to all devices.
28 BASE_EXPORT bool IsEnterpriseDevice();
30 // Returns true if the device is either managed or enterprise. In general, it is
31 // recommended to use the PlatformManagementService to obtain this information,
33 BASE_EXPORT bool IsManagedOrEnterpriseDevice();
35 #if BUILDFLAG(IS_APPLE)
37 // Returns the state of the management of the device. For more details:
38 // https://blog.fleetsmith.com/what-is-user-approved-mdm-uamdm/ .
40 // These values are persisted to logs. Entries must not be renumbered and
41 // numeric values must never be reused.
42 enum class MacDeviceManagementState {
43 kFailureAPIUnavailable = 0,
44 kFailureUnableToParseResult = 1,
46 kLimitedMDMEnrollment = 3,
47 kFullMDMEnrollment = 4,
48 kDEPMDMEnrollment = 5,
50 kMaxValue = kDEPMDMEnrollment
52 BASE_EXPORT MacDeviceManagementState IsDeviceRegisteredWithManagement();
54 // Returns whether the device and/or the current user is enrolled to a domain.
55 struct DeviceUserDomainJoinState {
59 BASE_EXPORT DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain();
61 #endif // BUILDFLAG(IS_APPLE)
65 #endif // BASE_ENTERPRISE_UTIL_H_