Commit 52fe599d authored by Jaeyong Bae's avatar Jaeyong Bae Committed by Commit Bot

[PasswordManager] Remove generation_popup_was_shown

This patch does remove generation_popup_was_shown as param on
SetGenerationPopupWasShown function. Because it is always true.

Bug: 831123
Change-Id: I04004b5c77c62f8ab425866c3e93197b60522ff5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872073Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Jaeyong Bae <jdragon.bae@gmail.com>
Cr-Commit-Position: refs/heads/master@{#707848}
parent 89bfce2d
......@@ -504,11 +504,10 @@ bool PasswordFormManager::HasGeneratedPassword() const {
}
void PasswordFormManager::SetGenerationPopupWasShown(
bool generation_popup_was_shown,
bool is_manual_generation) {
votes_uploader_.set_generation_popup_was_shown(generation_popup_was_shown);
votes_uploader_.set_generation_popup_was_shown(true);
votes_uploader_.set_is_manual_generation(is_manual_generation);
metrics_recorder_->SetPasswordGenerationPopupShown(generation_popup_was_shown,
metrics_recorder_->SetPasswordGenerationPopupShown(true,
is_manual_generation);
}
......
......@@ -162,8 +162,7 @@ class PasswordFormManager : public PasswordFormManagerForUI,
void PresaveGeneratedPassword(const autofill::PasswordForm& form);
void PasswordNoLongerGenerated();
bool HasGeneratedPassword() const;
void SetGenerationPopupWasShown(bool generation_popup_was_shown,
bool is_manual_generation);
void SetGenerationPopupWasShown(bool is_manual_generation);
void SetGenerationElement(const base::string16& generation_element);
bool IsPossibleChangePasswordFormWithoutUsername() const;
bool IsPasswordUpdate() const;
......
......@@ -1383,8 +1383,7 @@ TEST_F(PasswordFormManagerTest, PresaveGeneratedPasswordEmptyStore) {
MockFormSaver& form_saver = MockFormSaver::Get(form_manager_.get());
form_manager_->SetGenerationPopupWasShown(
true /* generation_popup_was_shown */, false /* is_manual_generation */);
form_manager_->SetGenerationPopupWasShown(false /* is_manual_generation */);
// Check that the generated password is presaved.
PasswordForm saved_form;
......@@ -1439,8 +1438,7 @@ TEST_F(PasswordFormManagerTest, PresaveGenerated_ModifiedUsername) {
MockFormSaver& form_saver = MockFormSaver::Get(form_manager_.get());
form_manager_->SetGenerationPopupWasShown(
true /* generation_popup_was_shown */, false /* is_manual_generation */);
form_manager_->SetGenerationPopupWasShown(false /* is_manual_generation */);
// Check that the generated password is presaved.
PasswordForm saved_form;
......@@ -1539,8 +1537,7 @@ TEST_F(PasswordFormManagerTest, PasswordNoLongerGenerated) {
fetcher_->NotifyFetchCompleted();
MockFormSaver& form_saver = MockFormSaver::Get(form_manager_.get());
form_manager_->SetGenerationPopupWasShown(
true /* generation_popup_was_shown */, true /* is_manual_generation */);
form_manager_->SetGenerationPopupWasShown(true /* is_manual_generation */);
EXPECT_CALL(form_saver, Save(_, _, _));
......@@ -1574,8 +1571,7 @@ TEST_F(PasswordFormManagerTest, PresaveGeneratedPasswordExistingCredential) {
MockFormSaver& form_saver = MockFormSaver::Get(form_manager_.get());
form_manager_->SetGenerationPopupWasShown(
true /* generation_popup_was_shown */, false /* is_manual_generation */);
form_manager_->SetGenerationPopupWasShown(false /* is_manual_generation */);
// Check that the generated password is presaved.
PasswordForm saved_form;
......@@ -1825,8 +1821,7 @@ TEST_F(PasswordFormManagerTest, GenerationUploadOnNoInteraction) {
if (generation_popup_shown) {
form_manager_->SetGenerationElement(ASCIIToUTF16("password"));
form_manager_->SetGenerationPopupWasShown(
true /*generation_popup_was_shown*/, false /*is_manual_generation*/);
form_manager_->SetGenerationPopupWasShown(false /*is_manual_generation*/);
}
EXPECT_TRUE(
form_manager_->ProvisionallySave(submitted_form_, &driver_, nullptr));
......@@ -1851,8 +1846,7 @@ TEST_F(PasswordFormManagerTest, GenerationUploadOnNeverClicked) {
if (generation_popup_shown) {
form_manager_->SetGenerationElement(ASCIIToUTF16("password"));
form_manager_->SetGenerationPopupWasShown(
true /*generation_popup_was_shown*/, false /*is_manual_generation*/);
form_manager_->SetGenerationPopupWasShown(false /*is_manual_generation*/);
}
EXPECT_TRUE(
form_manager_->ProvisionallySave(submitted_form_, &driver_, nullptr));
......
......@@ -245,7 +245,7 @@ void PasswordManager::SetGenerationElementAndReasonForForm(
PasswordFormManager* form_manager = GetMatchedManager(driver, form);
if (form_manager) {
form_manager->SetGenerationElement(generation_element);
form_manager->SetGenerationPopupWasShown(true, is_manually_triggered);
form_manager->SetGenerationPopupWasShown(is_manually_triggered);
}
}
......
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