Chromium Code Reviews| 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 e4408a1b471359dfe37029a2440dafcdd41b02ff..dac35ce23728dec58a59b1f866a8a62585b99f99 100644 |
| --- a/chrome/browser/signin/easy_unlock_service.cc |
| +++ b/chrome/browser/signin/easy_unlock_service.cc |
| @@ -171,10 +171,6 @@ void EasyUnlockService::RegisterProfilePrefs( |
| prefs::kEasyUnlockEnabled, |
| false, |
| user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| - registry->RegisterBooleanPref( |
| - prefs::kEasyUnlockShowTutorial, |
| - true, |
| - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| registry->RegisterDictionaryPref( |
| prefs::kEasyUnlockPairing, |
| new base::DictionaryValue(), |
| @@ -191,7 +187,7 @@ void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) { |
| } |
| // static |
| -void EasyUnlockService::RemoveHardlockStateForUser(const std::string& user_id) { |
| +void EasyUnlockService::ResetLocalStateForUser(const std::string& user_id) { |
| DCHECK(!user_id.empty()); |
| PrefService* local_state = GetLocalState(); |
| @@ -263,7 +259,6 @@ EasyUnlockScreenlockStateHandler* |
| screenlock_state_handler_.reset(new EasyUnlockScreenlockStateHandler( |
| GetUserEmail(), |
| GetHardlockState(), |
| - GetType() == TYPE_REGULAR ? profile_->GetPrefs() : NULL, |
| ScreenlockBridge::Get())); |
| } |
| return screenlock_state_handler_.get(); |
| @@ -344,6 +339,14 @@ void EasyUnlockService::CheckCryptohomeKeysAndMaybeHardlock() { |
| #endif |
| } |
| +void EasyUnlockService::SetTrialRun() { |
| + DCHECK(GetType() == TYPE_REGULAR); |
| + |
| + EasyUnlockScreenlockStateHandler* handler = GetScreenlockStateHandler(); |
| + if (handler) |
| + handler->SetTrialRun(); |
| +} |
| + |
| void EasyUnlockService::AddObserver(EasyUnlockServiceObserver* observer) { |
| observers_.AddObserver(observer); |
| } |
| @@ -539,7 +542,8 @@ void EasyUnlockService::OnCryptohomeKeysFetchedForChecking( |
| for (const auto& device_key_data : key_data_list) |
| devices_in_cryptohome.insert(device_key_data.public_key); |
| - if (paired_devices != devices_in_cryptohome) { |
| + if (paired_devices != devices_in_cryptohome || |
| + GetHardlockState() == EasyUnlockScreenlockStateHandler::NO_PAIRING) { |
|
xiyuan
2014/10/09 21:03:55
Why do we need to map NO_PAIRING to PAIRING_CHANGE
|
| SetHardlockStateForUser(user_id, |
| EasyUnlockScreenlockStateHandler::PAIRING_CHANGED); |
| } |