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

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: Fix components tests Created 4 years 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // Also enforce extension settings and default search. 257 // Also enforce extension settings and default search.
258 GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE, 258 GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE,
259 // The default enforcement group contains all protection features. 259 // The default enforcement group contains all protection features.
260 GROUP_ENFORCE_DEFAULT 260 GROUP_ENFORCE_DEFAULT
261 }; 261 };
262 262
263 SettingsEnforcementGroup GetSettingsEnforcementGroup() { 263 SettingsEnforcementGroup GetSettingsEnforcementGroup() {
264 # if defined(OS_WIN) 264 # if defined(OS_WIN)
265 if (!g_disable_domain_check_for_testing) { 265 if (!g_disable_domain_check_for_testing) {
266 static bool first_call = true; 266 static bool first_call = true;
267 static const bool is_enrolled_to_domain = base::win::IsEnrolledToDomain(); 267 static const bool is_enterprise_user = base::win::IsEnterpriseUser();
268 if (first_call) { 268 if (first_call) {
269 UMA_HISTOGRAM_BOOLEAN("Settings.TrackedPreferencesNoEnforcementOnDomain", 269 UMA_HISTOGRAM_BOOLEAN("Settings.TrackedPreferencesNoEnforcementOnDomain",
270 is_enrolled_to_domain); 270 is_enterprise_user);
271 first_call = false; 271 first_call = false;
272 } 272 }
273 if (is_enrolled_to_domain) 273 if (is_enterprise_user)
274 return GROUP_NO_ENFORCEMENT; 274 return GROUP_NO_ENFORCEMENT;
275 } 275 }
276 #endif 276 #endif
277 277
278 struct { 278 struct {
279 const char* group_name; 279 const char* group_name;
280 SettingsEnforcementGroup group; 280 SettingsEnforcementGroup group;
281 } static const kEnforcementLevelMap[] = { 281 } static const kEnforcementLevelMap[] = {
282 { chrome_prefs::internals::kSettingsEnforcementGroupNoEnforcement, 282 { chrome_prefs::internals::kSettingsEnforcementGroupNoEnforcement,
283 GROUP_NO_ENFORCEMENT }, 283 GROUP_NO_ENFORCEMENT },
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 541
542 void ClearResetTime(Profile* profile) { 542 void ClearResetTime(Profile* profile) {
543 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); 543 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs());
544 } 544 }
545 545
546 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { 546 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
547 ProfilePrefStoreManager::RegisterProfilePrefs(registry); 547 ProfilePrefStoreManager::RegisterProfilePrefs(registry);
548 } 548 }
549 549
550 } // namespace chrome_prefs 550 } // namespace chrome_prefs
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698