Index: chrome/browser/signin/easy_unlock_service_regular.cc |
diff --git a/chrome/browser/signin/easy_unlock_service_regular.cc b/chrome/browser/signin/easy_unlock_service_regular.cc |
index ce6c1739e4c0fecb113e0014b747fb7c91017f22..e0814e2bb24792c7e184cc9f536b1db533f1b7df 100644 |
--- a/chrome/browser/signin/easy_unlock_service_regular.cc |
+++ b/chrome/browser/signin/easy_unlock_service_regular.cc |
@@ -32,6 +32,9 @@ const char kKeyPermitAccess[] = "permitAccess"; |
// Key name of the remote device list in kEasyUnlockPairing. |
const char kKeyDevices[] = "devices"; |
+// Key name of the hardlocked flag in kEasyUnlockPairing. |
+const char kKeyHardlocked[] = "hardlocked"; |
+ |
// Key name of the phone public key in a device dictionary. |
const char kKeyPhoneId[] = "permitRecord.id"; |
@@ -110,6 +113,23 @@ void EasyUnlockServiceRegular::ClearRemoteDevices() { |
pairing_update->RemoveWithoutPathExpansion(kKeyDevices, NULL); |
} |
+void EasyUnlockServiceRegular::SetHardlocked(bool value) { |
+ DictionaryPrefUpdate pairing_update(profile()->GetPrefs(), |
+ prefs::kEasyUnlockPairing); |
+ pairing_update->SetBooleanWithoutPathExpansion(kKeyHardlocked, value); |
+ |
+ SetScreenlockHardlockedState(value); |
+} |
+ |
+bool EasyUnlockServiceRegular::IsHardlocked() const { |
+ const base::DictionaryValue* pairing_dict = |
+ profile()->GetPrefs()->GetDictionary(prefs::kEasyUnlockPairing); |
+ bool hardlocked = false; |
+ return pairing_dict && |
+ pairing_dict->GetBoolean(kKeyHardlocked, &hardlocked) && |
+ hardlocked; |
+} |
+ |
void EasyUnlockServiceRegular::RunTurnOffFlow() { |
if (turn_off_flow_status_ == PENDING) |
return; |