xref: /aosp_15_r20/external/cronet/base/enterprise_util_win.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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.
4 
5 #include "base/enterprise_util.h"
6 
7 #include "base/win/win_util.h"
8 #include "base/win/windows_version.h"
9 
10 namespace base {
11 
IsManagedDevice()12 bool IsManagedDevice() {
13   // Legacy domain join does not actually guarantee that the device is managed,
14   // however there is no API that can be used to determine if any group policies
15   // are actually being applied. As such, for these devices we need to assume
16   // they are managed.
17   // In addition, simply being joined to AAD does not mean the device is being
18   // managed by the AAD tenant, so checking for AAD join is not included here.
19   return base::win::IsEnrolledToDomain() ||
20          base::win::IsDeviceRegisteredWithManagement();
21 }
22 
IsEnterpriseDevice()23 bool IsEnterpriseDevice() {
24   // Both legacy domain join and AAD join represent machine-wide enterprise
25   // join.
26   return base::win::IsEnrolledToDomain() || base::win::IsJoinedToAzureAD();
27 }
28 
29 }  // namespace base
30