diff options
Diffstat (limited to 'chromium/components/safe_browsing/common/utils.cc')
-rw-r--r-- | chromium/components/safe_browsing/common/utils.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chromium/components/safe_browsing/common/utils.cc b/chromium/components/safe_browsing/common/utils.cc index 3e823e115ee..2d17295d15f 100644 --- a/chromium/components/safe_browsing/common/utils.cc +++ b/chromium/components/safe_browsing/common/utils.cc @@ -6,8 +6,14 @@ #include "base/metrics/histogram_macros.h" #include "base/strings/string_number_conversions.h" +#include "build/build_config.h" +#include "components/policy/core/browser/browser_policy_connector.h" #include "crypto/sha2.h" +#if defined(OS_WIN) +#include "base/win/win_util.h" +#endif + namespace safe_browsing { std::string ShortURLForReporting(const GURL& url) { @@ -27,4 +33,20 @@ void LogNoUserActionResourceLoadingDelay(base::TimeDelta time) { UMA_HISTOGRAM_LONG_TIMES("SB2.NoUserActionResourceLoadingDelay", time); } +ChromeUserPopulation::ProfileManagementStatus GetProfileManagementStatus( + const policy::BrowserPolicyConnector* bpc) { +#if defined(OS_WIN) + if (base::win::IsEnterpriseManaged()) + return ChromeUserPopulation::ENTERPRISE_MANAGED; + else + return ChromeUserPopulation::NOT_MANAGED; +#elif defined(OS_CHROMEOS) + if (!bpc || !bpc->IsEnterpriseManaged()) + return ChromeUserPopulation::NOT_MANAGED; + return ChromeUserPopulation::ENTERPRISE_MANAGED; +#else + return ChromeUserPopulation::UNAVAILABLE; +#endif // #if defined(OS_WIN) || defined(OS_CHROMEOS) +} + } // namespace safe_browsing |