| Index: chrome/browser/signin/easy_unlock_service.cc
|
| diff --git a/chrome/browser/signin/easy_unlock_service.cc b/chrome/browser/signin/easy_unlock_service.cc
|
| index 2473c8d6d47fa95a65ec1642854f53524cc2bfbb..95f937358ac9f3ae8b74977b0f7ff7ff9eafef6f 100644
|
| --- a/chrome/browser/signin/easy_unlock_service.cc
|
| +++ b/chrome/browser/signin/easy_unlock_service.cc
|
| @@ -65,6 +65,12 @@ PrefService* GetLocalState() {
|
|
|
| } // namespace
|
|
|
| +EasyUnlockService::UserSettings::UserSettings() : check_close_proximity(false) {
|
| +}
|
| +
|
| +EasyUnlockService::UserSettings::~UserSettings() {
|
| +}
|
| +
|
| // static
|
| EasyUnlockService* EasyUnlockService::Get(Profile* profile) {
|
| return EasyUnlockServiceFactory::GetForProfile(profile);
|
| @@ -233,6 +239,7 @@ void EasyUnlockService::RegisterProfilePrefs(
|
|
|
| // static
|
| void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) {
|
| + registry->RegisterDictionaryPref(prefs::kEasyUnlockLocalStateUserPrefs);
|
| registry->RegisterDictionaryPref(prefs::kEasyUnlockHardlockState);
|
| #if defined(OS_CHROMEOS)
|
| EasyUnlockTpmKeyManager::RegisterLocalStatePrefs(registry);
|
| @@ -255,6 +262,33 @@ void EasyUnlockService::ResetLocalStateForUser(const std::string& user_id) {
|
| #endif
|
| }
|
|
|
| +// static
|
| +EasyUnlockService::UserSettings EasyUnlockService::GetUserSettings(
|
| + const std::string& user_id) {
|
| + DCHECK(!user_id.empty());
|
| + UserSettings user_settings;
|
| +
|
| + PrefService* local_state = GetLocalState();
|
| + if (!local_state)
|
| + return user_settings;
|
| +
|
| + const base::DictionaryValue* all_user_prefs_dict =
|
| + local_state->GetDictionary(prefs::kEasyUnlockLocalStateUserPrefs);
|
| + if (!all_user_prefs_dict)
|
| + return user_settings;
|
| +
|
| + const base::DictionaryValue* user_prefs_dict;
|
| + if (!all_user_prefs_dict->GetDictionaryWithoutPathExpansion(user_id,
|
| + &user_prefs_dict))
|
| + return user_settings;
|
| +
|
| + user_prefs_dict->GetBooleanWithoutPathExpansion(
|
| + prefs::kEasyUnlockProximityRequired,
|
| + &user_settings.check_close_proximity);
|
| +
|
| + return user_settings;
|
| +}
|
| +
|
| bool EasyUnlockService::IsAllowed() {
|
| if (shut_down_)
|
| return false;
|
|
|