Commit a9b166bd authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

[Passwords] Introduce OnCompromisedCredentialsChangedIn() in ...

... DatabaseCompromisedCredentialsObserver.
This is similar to OnCompromisedCredentialsChanged(), but also receives
the  originating PasswordStore as a parameter.

Bug: 1108422
Change-Id: I76fffc36c65554bbe3e812c9e21ab229437f20a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2368554
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800535}
parent 19c545e8
......@@ -89,6 +89,11 @@ void PasswordStore::Observer::OnLoginsChangedIn(
OnLoginsChanged(changes);
}
void PasswordStore::DatabaseCompromisedCredentialsObserver::
OnCompromisedCredentialsChangedIn(PasswordStore* store) {
OnCompromisedCredentialsChanged();
}
#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED)
PasswordStore::CheckReuseRequest::CheckReuseRequest(
PasswordReuseDetectorConsumer* consumer)
......@@ -786,8 +791,10 @@ void PasswordStore::InvokeAndNotifyAboutCompromisedPasswordsChange(
DCHECK(background_task_runner_->RunsTasksInCurrentSequence());
if (std::move(callback).Run()) {
compromised_credentials_observers_->Notify(
FROM_HERE, &DatabaseCompromisedCredentialsObserver::
OnCompromisedCredentialsChanged);
FROM_HERE,
&DatabaseCompromisedCredentialsObserver::
OnCompromisedCredentialsChangedIn,
base::RetainedRef(this));
}
}
......
......@@ -111,6 +111,13 @@ class PasswordStore : protected PasswordStoreSync,
// Will be called from the UI thread.
virtual void OnCompromisedCredentialsChanged() = 0;
// Like OnCompromisedCredentialsChanged(), but also receives the originating
// PasswordStore as a parameter. This is useful for observers that observe
// changes in both the profile-scoped and the account-scoped store. The
// default implementation simply calls OnCompromisedCredentialsChanged(), so
// observers that don't care about the store can just ignore this.
virtual void OnCompromisedCredentialsChangedIn(PasswordStore* store);
protected:
virtual ~DatabaseCompromisedCredentialsObserver() = default;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment