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/signin/easy_unlock_service_regular.h" | 5 #include "chrome/browser/signin/easy_unlock_service_regular.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 return false; | 184 return false; |
185 | 185 |
186 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile())) | 186 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile())) |
187 return false; | 187 return false; |
188 | 188 |
189 if (!profile()->GetPrefs()->GetBoolean(prefs::kEasyUnlockAllowed)) | 189 if (!profile()->GetPrefs()->GetBoolean(prefs::kEasyUnlockAllowed)) |
190 return false; | 190 return false; |
191 | 191 |
192 // Respect existing policy and skip finch test. | 192 // Respect existing policy and skip finch test. |
193 if (!profile()->GetPrefs()->IsManagedPreference(prefs::kEasyUnlockAllowed)) { | 193 if (!profile()->GetPrefs()->IsManagedPreference(prefs::kEasyUnlockAllowed)) { |
194 // It is disabled when the trial exists and is in "Disable" group. | 194 // It is enabled when the trial exists and is in "Enable" group. |
195 if (base::FieldTrialList::FindFullName("EasyUnlock") == "Disable") | 195 return base::FieldTrialList::FindFullName("EasyUnlock") == "Enable"; |
196 return false; | |
197 } | 196 } |
198 | 197 |
199 return true; | 198 return true; |
200 #else | 199 #else |
201 // TODO(xiyuan): Revisit when non-chromeos platforms are supported. | 200 // TODO(xiyuan): Revisit when non-chromeos platforms are supported. |
202 return false; | 201 return false; |
203 #endif | 202 #endif |
204 } | 203 } |
205 | 204 |
206 void EasyUnlockServiceRegular::OnPrefsChanged() { | 205 void EasyUnlockServiceRegular::OnPrefsChanged() { |
(...skipping 10 matching lines...) Expand all Loading... |
217 | 216 |
218 if (!success) { | 217 if (!success) { |
219 SetTurnOffFlowStatus(FAIL); | 218 SetTurnOffFlowStatus(FAIL); |
220 return; | 219 return; |
221 } | 220 } |
222 | 221 |
223 ClearRemoteDevices(); | 222 ClearRemoteDevices(); |
224 SetTurnOffFlowStatus(IDLE); | 223 SetTurnOffFlowStatus(IDLE); |
225 ReloadApp(); | 224 ReloadApp(); |
226 } | 225 } |
OLD | NEW |