1 // Copyright 2019 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.
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. This includes
14 // but is not limited to the presence of user accounts from a centralized
15 // directory or the presence of dynamically updatable machine policies from an
16 // outside administrator.
17 BASE_EXPORT bool IsMachineExternallyManaged();
21 // Returns true if the device is being managed by an MDM system. Uses an old API
22 // not intended for the purpose.
23 enum class MacDeviceManagementStateOld {
24 kFailureAPIUnavailable = 0,
25 kFailureUnableToParseResult = 1,
29 kMaxValue = kMDMEnrollment
31 BASE_EXPORT MacDeviceManagementStateOld IsDeviceRegisteredWithManagementOld();
33 // Returns the state of the management of the device. Uses a new API so results
34 // aren't always available. For more details, this is documented at
35 // https://blog.fleetsmith.com/what-is-user-approved-mdm-uamdm/ .
37 // These values are persisted to logs. Entries must not be renumbered and
38 // numeric values must never be reused.
39 enum class MacDeviceManagementStateNew {
40 kFailureAPIUnavailable = 0,
41 kFailureUnableToParseResult = 1,
43 kLimitedMDMEnrollment = 3,
44 kFullMDMEnrollment = 4,
45 kDEPMDMEnrollment = 5,
47 kMaxValue = kDEPMDMEnrollment
49 BASE_EXPORT MacDeviceManagementStateNew IsDeviceRegisteredWithManagementNew();
51 // Returns whether the device and/or the current user is enrolled to a domain.
52 struct DeviceUserDomainJoinState {
56 BASE_EXPORT DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain();
62 #endif // BASE_ENTERPRISE_UTIL_H_