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

Unified Diff: chrome/browser/signin/easy_unlock_service_regular.cc

Issue 608693006: [Easy Unlock] When hardlocking, show a different icon on user (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
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;
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_regular.h ('k') | chrome/browser/signin/easy_unlock_service_signin_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698