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

Side by Side Diff: chrome/browser/supervised_user/child_accounts/child_account_service.cc

Issue 1020173002: Enable child account detection by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/supervised_user/child_accounts/child_account_service.h" 5 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // UMA reports the correct group. 85 // UMA reports the correct group.
86 const std::string group_name = 86 const std::string group_name =
87 base::FieldTrialList::FindFullName(kChildAccountDetectionFieldTrialName); 87 base::FieldTrialList::FindFullName(kChildAccountDetectionFieldTrialName);
88 88
89 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 89 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
90 if (command_line->HasSwitch(switches::kDisableChildAccountDetection)) 90 if (command_line->HasSwitch(switches::kDisableChildAccountDetection))
91 return false; 91 return false;
92 if (command_line->HasSwitch(switches::kEnableChildAccountDetection)) 92 if (command_line->HasSwitch(switches::kEnableChildAccountDetection))
93 return true; 93 return true;
94 94
95 return group_name == "Enabled"; 95 if (group_name == "Disabled")
96 return false;
97 return true;
96 } 98 }
97 99
98 void ChildAccountService::RegisterProfilePrefs( 100 void ChildAccountService::RegisterProfilePrefs(
99 user_prefs::PrefRegistrySyncable* registry) { 101 user_prefs::PrefRegistrySyncable* registry) {
100 registry->RegisterBooleanPref( 102 registry->RegisterBooleanPref(
101 prefs::kChildAccountStatusKnown, 103 prefs::kChildAccountStatusKnown,
102 false, 104 false,
103 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 105 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
104 } 106 }
105 107
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 command_line->AppendSwitch(switches::kEnableSupervisedUserBlacklist); 439 command_line->AppendSwitch(switches::kEnableSupervisedUserBlacklist);
438 440
439 // Query-based filtering also defaults to enabled. 441 // Query-based filtering also defaults to enabled.
440 bool has_enable_safesites = 442 bool has_enable_safesites =
441 command_line->HasSwitch(switches::kEnableSupervisedUserSafeSites); 443 command_line->HasSwitch(switches::kEnableSupervisedUserSafeSites);
442 bool has_disable_safesites = 444 bool has_disable_safesites =
443 command_line->HasSwitch(switches::kDisableSupervisedUserSafeSites); 445 command_line->HasSwitch(switches::kDisableSupervisedUserSafeSites);
444 if (!has_enable_safesites && !has_disable_safesites) 446 if (!has_enable_safesites && !has_disable_safesites)
445 command_line->AppendSwitch(switches::kEnableSupervisedUserSafeSites); 447 command_line->AppendSwitch(switches::kEnableSupervisedUserSafeSites);
446 } 448 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698