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

Side by Side Diff: chrome/browser/signin/easy_unlock_service_regular.cc

Issue 649223003: easy-unlock: Tighten finch check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move a couple of tests to finch enabled suite and add a no finch test Created 6 years, 2 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 | « chrome/browser/signin/easy_unlock_service_browsertest_chromeos.cc ('k') | 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/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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_browsertest_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698