Commit 05931d3d authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

PasswordSaveManagerImpl: Pull CreatePendingCredentials into a static helper

This is a first step towards making this logic reusable and
customizable for the MultiStorePasswordSaveManager.

Bug: 1012203
Change-Id: I5875c083e8b7439677ac315c0be30de61ab08c69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2116080
Commit-Queue: Marc Treib <treib@chromium.org>
Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753276}
parent 4c4a936c
......@@ -38,8 +38,8 @@ class PasswordSaveManagerImpl : public PasswordSaveManager {
scoped_refptr<PasswordFormMetricsRecorder> metrics_recorder,
VotesUploader* votes_uploader) override;
// Create pending credentials from |parsed_submitted_form| and
// |parsed_observed_form| and |submitted_form|.
// Create pending credentials from |parsed_submitted_form|, |observed_form|
// and |submitted_form|.
void CreatePendingCredentials(
const autofill::PasswordForm& parsed_submitted_form,
const autofill::FormData& observed_form,
......@@ -84,6 +84,16 @@ class PasswordSaveManagerImpl : public PasswordSaveManager {
#endif
protected:
static PendingCredentialsState FillPendingCredentials(
const autofill::PasswordForm& parsed_submitted_form,
const autofill::FormData& observed_form,
const autofill::FormData& submitted_form,
const base::Optional<base::string16>& generated_password,
bool is_http_auth,
bool is_credential_api_save,
const autofill::PasswordForm* similar_saved_form,
autofill::PasswordForm* pending_credentials);
// Returns the form_saver to be used for generated passwords. Subclasses will
// override this method to provide different logic for get the form saver.
virtual FormSaver* GetFormSaverForGeneration();
......@@ -119,15 +129,6 @@ class PasswordSaveManagerImpl : public PasswordSaveManager {
const FormFetcher* form_fetcher_;
private:
// Create pending credentials from provisionally saved form when this form
// represents credentials that were not previously saved.
void CreatePendingCredentialsForNewCredentials(
const autofill::PasswordForm& parsed_submitted_form,
const autofill::FormData& observed_form,
const base::string16& password_element,
bool is_http_auth,
bool is_credential_api_save);
// Save/update |pending_credentials_| to the password store.
void SavePendingToStore(const autofill::PasswordForm& parsed_submitted_form,
bool update);
......
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