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.h" | 5 #include "chrome/browser/signin/easy_unlock_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 #if defined(OS_CHROMEOS) | 189 #if defined(OS_CHROMEOS) |
190 if (!user_manager::UserManager::Get()->IsLoggedInAsRegularUser()) | 190 if (!user_manager::UserManager::Get()->IsLoggedInAsRegularUser()) |
191 return false; | 191 return false; |
192 | 192 |
193 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile_)) | 193 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile_)) |
194 return false; | 194 return false; |
195 | 195 |
196 if (!profile_->GetPrefs()->GetBoolean(prefs::kEasyUnlockAllowed)) | 196 if (!profile_->GetPrefs()->GetBoolean(prefs::kEasyUnlockAllowed)) |
197 return false; | 197 return false; |
198 | 198 |
199 // It is disabled when the trial exists and is in "Disable" group. | 199 // Respect existing policy and skip finch test. |
200 if (base::FieldTrialList::FindFullName("EasyUnlock") == "Disable") | 200 if (!profile_->GetPrefs()->IsManagedPreference(prefs::kEasyUnlockAllowed)) { |
201 return false; | 201 // It is disabled when the trial exists and is in "Disable" group. |
| 202 if (base::FieldTrialList::FindFullName("EasyUnlock") == "Disable") |
| 203 return false; |
| 204 } |
202 | 205 |
203 if (!bluetooth_detector_->IsPresent()) | 206 if (!bluetooth_detector_->IsPresent()) |
204 return false; | 207 return false; |
205 | 208 |
206 return true; | 209 return true; |
207 #else | 210 #else |
208 // TODO(xiyuan): Revisit when non-chromeos platforms are supported. | 211 // TODO(xiyuan): Revisit when non-chromeos platforms are supported. |
209 return false; | 212 return false; |
210 #endif | 213 #endif |
211 } | 214 } |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 // Make sure lock screen state set by the extension gets reset. | 437 // Make sure lock screen state set by the extension gets reset. |
435 screenlock_state_handler_.reset(); | 438 screenlock_state_handler_.reset(); |
436 | 439 |
437 if (GetComponentLoader(profile_)->Exists(extension_misc::kEasyUnlockAppId)) { | 440 if (GetComponentLoader(profile_)->Exists(extension_misc::kEasyUnlockAppId)) { |
438 extensions::ExtensionSystem* extension_system = | 441 extensions::ExtensionSystem* extension_system = |
439 extensions::ExtensionSystem::Get(profile_); | 442 extensions::ExtensionSystem::Get(profile_); |
440 extension_system->extension_service()->ReloadExtension( | 443 extension_system->extension_service()->ReloadExtension( |
441 extension_misc::kEasyUnlockAppId); | 444 extension_misc::kEasyUnlockAppId); |
442 } | 445 } |
443 } | 446 } |
OLD | NEW |