enterprise_util_win.cc 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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.
  4. #include "base/enterprise_util.h"
  5. #include "base/win/win_util.h"
  6. #include "base/win/windows_version.h"
  7. namespace base {
  8. bool IsManagedDevice() {
  9. // Legacy domain join does not actually guarantee that the device is managed,
  10. // however there is no API that can be used to determine if any group policies
  11. // are actually being applied. As such, for these devices we need to assume
  12. // they are managed.
  13. // IsDeviceRegisteredWithManagement() can be true for devices running the Home
  14. // sku, however the Home sku does not allow for management of the web browser.
  15. // As such, we only include devices running a non-Home sku.
  16. // In addition, simply being joined to AAD does not mean the device is being
  17. // managed by the AAD tenant, so checking for AAD join is not included here.
  18. return base::win::IsEnrolledToDomain() ||
  19. (base::win::IsDeviceRegisteredWithManagement() &&
  20. (base::win::OSInfo::GetInstance()->version_type() !=
  21. base::win::SUITE_HOME));
  22. }
  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. } // namespace base