OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |