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

Side by Side Diff: chrome/browser/prefs/chrome_pref_service_factory.cc

Issue 2581353002: Use the Windows MDM API to check if the machine is being managed. (Closed)
Patch Set: rebased Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <chrome/browser/prefs/chrome_command_line_pref_store.h> 5 #include <chrome/browser/prefs/chrome_command_line_pref_store.h>
6 #include "chrome/browser/prefs/chrome_pref_service_factory.h" 6 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // Also enforce extension settings and default search. 239 // Also enforce extension settings and default search.
240 GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE, 240 GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE,
241 // The default enforcement group contains all protection features. 241 // The default enforcement group contains all protection features.
242 GROUP_ENFORCE_DEFAULT 242 GROUP_ENFORCE_DEFAULT
243 }; 243 };
244 244
245 SettingsEnforcementGroup GetSettingsEnforcementGroup() { 245 SettingsEnforcementGroup GetSettingsEnforcementGroup() {
246 # if defined(OS_WIN) 246 # if defined(OS_WIN)
247 if (!g_disable_domain_check_for_testing) { 247 if (!g_disable_domain_check_for_testing) {
248 static bool first_call = true; 248 static bool first_call = true;
249 static const bool is_enrolled_to_domain = base::win::IsEnrolledToDomain(); 249 static const bool is_managed = base::win::IsEnterpriseManaged();
250 if (first_call) { 250 if (first_call) {
251 UMA_HISTOGRAM_BOOLEAN("Settings.TrackedPreferencesNoEnforcementOnDomain", 251 UMA_HISTOGRAM_BOOLEAN("Settings.TrackedPreferencesNoEnforcementOnDomain",
252 is_enrolled_to_domain); 252 is_managed);
253 first_call = false; 253 first_call = false;
254 } 254 }
255 if (is_enrolled_to_domain) 255 if (is_managed)
256 return GROUP_NO_ENFORCEMENT; 256 return GROUP_NO_ENFORCEMENT;
257 } 257 }
258 #endif 258 #endif
259 259
260 struct { 260 struct {
261 const char* group_name; 261 const char* group_name;
262 SettingsEnforcementGroup group; 262 SettingsEnforcementGroup group;
263 } static const kEnforcementLevelMap[] = { 263 } static const kEnforcementLevelMap[] = {
264 { chrome_prefs::internals::kSettingsEnforcementGroupNoEnforcement, 264 { chrome_prefs::internals::kSettingsEnforcementGroupNoEnforcement,
265 GROUP_NO_ENFORCEMENT }, 265 GROUP_NO_ENFORCEMENT },
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 524
525 void ClearResetTime(Profile* profile) { 525 void ClearResetTime(Profile* profile) {
526 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); 526 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs());
527 } 527 }
528 528
529 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { 529 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
530 ProfilePrefStoreManager::RegisterProfilePrefs(registry); 530 ProfilePrefStoreManager::RegisterProfilePrefs(registry);
531 } 531 }
532 532
533 } // namespace chrome_prefs 533 } // namespace chrome_prefs
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698