diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-10-24 11:30:15 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-10-30 12:56:19 +0000 |
commit | 6036726eb981b6c4b42047513b9d3f4ac865daac (patch) | |
tree | 673593e70678e7789766d1f732eb51f613a2703b /chromium/base/win/win_util.h | |
parent | 466052c4e7c052268fd931888cd58961da94c586 (diff) |
BASELINE: Update Chromium to 70.0.3538.78
Change-Id: Ie634710bf039e26c1957f4ae45e101bd4c434ae7
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/base/win/win_util.h')
-rw-r--r-- | chromium/base/win/win_util.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/chromium/base/win/win_util.h b/chromium/base/win/win_util.h index 8bc5b8e54c5..8ee1ad1630e 100644 --- a/chromium/base/win/win_util.h +++ b/chromium/base/win/win_util.h @@ -29,6 +29,7 @@ #include <vector> #include "base/base_export.h" +#include "base/macros.h" #include "base/strings/string16.h" struct IPropertyStore; @@ -162,10 +163,6 @@ BASE_EXPORT bool IsDeviceRegisteredWithManagement(); // or registered with an MDM. BASE_EXPORT bool IsEnterpriseManaged(); -// Used by tests to mock any wanted state. Call with |state| set to true to -// simulate being in a domain and false otherwise. -BASE_EXPORT void SetDomainStateForTesting(bool state); - // Returns true if the current process can make USER32 or GDI32 calls such as // CreateWindow and CreateDC. Windows 8 and above allow the kernel component // of these calls to be disabled which can cause undefined behaviour such as @@ -192,6 +189,30 @@ BASE_EXPORT bool IsProcessPerMonitorDpiAware(); // Enable high-DPI support for the current process. BASE_EXPORT void EnableHighDPISupport(); +// Allows changing the domain enrolled state for the life time of the object. +// The original state is restored upon destruction. +class BASE_EXPORT ScopedDomainStateForTesting { + public: + ScopedDomainStateForTesting(bool state); + ~ScopedDomainStateForTesting(); + + private: + bool initial_state_; + DISALLOW_COPY_AND_ASSIGN(ScopedDomainStateForTesting); +}; + +// Allows changing the management registration state for the life time of the +// object. The original state is restored upon destruction. +class BASE_EXPORT ScopedDeviceRegisteredWithManagementForTesting { + public: + ScopedDeviceRegisteredWithManagementForTesting(bool state); + ~ScopedDeviceRegisteredWithManagementForTesting(); + + private: + bool initial_state_; + DISALLOW_COPY_AND_ASSIGN(ScopedDeviceRegisteredWithManagementForTesting); +}; + } // namespace win } // namespace base |