| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |