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

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

Issue 718673002: New user type introduced. Combines regular and supervised features. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Logical expression fixed. Created 6 years, 1 month 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 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 short_lived_user_context_.reset(); 263 short_lived_user_context_.reset();
264 #endif 264 #endif
265 265
266 turn_off_flow_.reset(); 266 turn_off_flow_.reset();
267 turn_off_flow_status_ = EasyUnlockService::IDLE; 267 turn_off_flow_status_ = EasyUnlockService::IDLE;
268 registrar_.RemoveAll(); 268 registrar_.RemoveAll();
269 } 269 }
270 270
271 bool EasyUnlockServiceRegular::IsAllowedInternal() { 271 bool EasyUnlockServiceRegular::IsAllowedInternal() {
272 #if defined(OS_CHROMEOS) 272 #if defined(OS_CHROMEOS)
273 if (!user_manager::UserManager::Get()->IsLoggedInAsRegularUser()) 273 if (!user_manager::UserManager::Get()->IsLoggedInAsUserWithGaiaAccount())
274 return false; 274 return false;
275 275
276 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile())) 276 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile()))
277 return false; 277 return false;
278 278
279 if (!profile()->GetPrefs()->GetBoolean(prefs::kEasyUnlockAllowed)) 279 if (!profile()->GetPrefs()->GetBoolean(prefs::kEasyUnlockAllowed))
280 return false; 280 return false;
281 281
282 // Respect existing policy and skip finch test. 282 // Respect existing policy and skip finch test.
283 if (!profile()->GetPrefs()->IsManagedPreference(prefs::kEasyUnlockAllowed)) { 283 if (!profile()->GetPrefs()->IsManagedPreference(prefs::kEasyUnlockAllowed)) {
(...skipping 22 matching lines...) Expand all
306 306
307 if (!success) { 307 if (!success) {
308 SetTurnOffFlowStatus(FAIL); 308 SetTurnOffFlowStatus(FAIL);
309 return; 309 return;
310 } 310 }
311 311
312 ClearRemoteDevices(); 312 ClearRemoteDevices();
313 SetTurnOffFlowStatus(IDLE); 313 SetTurnOffFlowStatus(IDLE);
314 ReloadApp(); 314 ReloadApp();
315 } 315 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698