Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: chrome/browser/prefs/chrome_pref_service_factory.cc

Issue 156693003: Disable SettingsEnforcement when the machine is connected to a domain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better approach Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/chrome_pref_service_factory.cc
diff --git a/chrome/browser/prefs/chrome_pref_service_factory.cc b/chrome/browser/prefs/chrome_pref_service_factory.cc
index b659c8bdcce4fd3faf19b6b78331907950108ea5..0035a97d933c53fde22cde7b7381cbf6cd3954b8 100644
--- a/chrome/browser/prefs/chrome_pref_service_factory.cc
+++ b/chrome/browser/prefs/chrome_pref_service_factory.cc
@@ -55,9 +55,12 @@
#include "chrome/browser/managed_mode/supervised_user_pref_store.h"
#endif
-#if defined(OS_WIN) && defined(ENABLE_RLZ)
+#if defined(OS_WIN)
+#include "base/win/win_util.h"
+#if defined(ENABLE_RLZ)
#include "rlz/lib/machine_id.h"
-#endif
+#endif // defined(ENABLE_RLZ)
+#endif // defined(OS_WIN)
using content::BrowserContext;
using content::BrowserThread;
@@ -158,6 +161,18 @@ enum SettingsEnforcementGroup {
};
SettingsEnforcementGroup GetSettingsEnforcementGroup() {
+# if defined(OS_WIN)
+ static bool first_call = true;
+ static const bool is_enrolled_to_domain = base::win::IsEnrolledToDomain();
+ if (first_call) {
+ UMA_HISTOGRAM_BOOLEAN("Settings.TrackedPreferencesNoEnforcementOnDomain",
+ is_enrolled_to_domain);
+ first_call = false;
+ }
+ if (is_enrolled_to_domain)
+ return GROUP_NO_ENFORCEMENT;
+#endif
+
struct {
const char* group_name;
SettingsEnforcementGroup group;
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698