[mullet m3] Remove trigger source from AED::OnSuggestionsReturned.
In a recent change, the trigger source became source is part of the
suggestion query and is now passed to the AED in AED::OnQuery. The
trigger source passed to AED::OnSuggestionsReturned therefore became
unused. This CL removes this unused parameter. As a result, the trigger
source is removed from the SingleFieldFormFiller interface and all its
implementations:
* AutocompleteHistoryManager
* IbanManager
* MerchantPromoCodeManager
* SingleFieldFormFillRounter
Existing tests are adjusted accordingly and 1 obsolete test is removed.
Bug: 1493361
Change-Id: If088e23ccd37cc8ef9c9a167aed85edaa8a10f30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5077270
Reviewed-by: Jan Keitel <jkeitel@google.com>
Commit-Queue: Timofey Chudakov <tchudakov@google.com>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1233246}
diff --git a/chrome/browser/autofill/autofill_autocomplete_browsertest.cc b/chrome/browser/autofill/autofill_autocomplete_browsertest.cc
index 2c91454..8051f6e 100644
--- a/chrome/browser/autofill/autofill_autocomplete_browsertest.cc
+++ b/chrome/browser/autofill/autofill_autocomplete_browsertest.cc
@@ -163,9 +163,8 @@
base::MockCallback<SingleFieldFormFiller::OnSuggestionsReturnedCallback>
callback;
std::vector<Suggestion> suggestions;
- EXPECT_CALL(callback, Run).WillOnce(testing::SaveArg<2>(&suggestions));
+ EXPECT_CALL(callback, Run).WillOnce(testing::SaveArg<1>(&suggestions));
EXPECT_TRUE(autocomplete_history_manager()->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
test::CreateTestFormField(/*label=*/"", input_name, prefix,
FormControlType::kInputText),
manager().client(), callback.Get(), SuggestionsContext()));
diff --git a/chrome/browser/autofill/autofill_uitest_util.cc b/chrome/browser/autofill/autofill_uitest_util.cc
index baa60de..de4294b6 100644
--- a/chrome/browser/autofill/autofill_uitest_util.cc
+++ b/chrome/browser/autofill/autofill_uitest_util.cc
@@ -125,9 +125,7 @@
std::vector<Suggestion> suggestions = {Suggestion(u"Test suggestion")};
test_api(static_cast<BrowserAutofillManager&>(driver.GetAutofillManager()))
.external_delegate()
- ->OnSuggestionsReturned(
- form.fields.front().global_id(), suggestions,
- AutofillSuggestionTriggerSource::kFormControlElementClicked);
+ ->OnSuggestionsReturned(form.fields.front().global_id(), suggestions);
}
} // namespace autofill
diff --git a/components/autofill/core/browser/autocomplete_history_manager.cc b/components/autofill/core/browser/autocomplete_history_manager.cc
index 0495cc4..5e1cc8f 100644
--- a/components/autofill/core/browser/autocomplete_history_manager.cc
+++ b/components/autofill/core/browser/autocomplete_history_manager.cc
@@ -77,7 +77,6 @@
}
bool AutocompleteHistoryManager::OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource trigger_source,
const FormFieldData& field,
const AutofillClient& client,
OnSuggestionsReturnedCallback on_suggestions_returned,
@@ -90,9 +89,8 @@
if (!IsMeaningfulFieldName(field.name) || !client.IsAutocompleteEnabled() ||
field.form_control_type == FormControlType::kTextArea ||
IsInAutofillSuggestionsDisabledExperiment()) {
- SendSuggestions({},
- QueryHandler(field.global_id(), trigger_source, field.value,
- std::move(on_suggestions_returned)));
+ SendSuggestions({}, QueryHandler(field.global_id(), field.value,
+ std::move(on_suggestions_returned)));
return true;
}
@@ -102,9 +100,8 @@
// We can simply insert, since |query_handle| is always unique.
pending_queries_.insert(
- {query_handle,
- QueryHandler(field.global_id(), trigger_source, field.value,
- std::move(on_suggestions_returned))});
+ {query_handle, QueryHandler(field.global_id(), field.value,
+ std::move(on_suggestions_returned))});
return true;
}
@@ -224,11 +221,9 @@
AutocompleteHistoryManager::QueryHandler::QueryHandler(
FieldGlobalId field_id,
- AutofillSuggestionTriggerSource trigger_source,
std::u16string prefix,
OnSuggestionsReturnedCallback on_suggestions_returned)
: field_id_(field_id),
- trigger_source_(trigger_source),
prefix_(std::move(prefix)),
on_suggestions_returned_(std::move(on_suggestions_returned)) {}
@@ -256,7 +251,7 @@
}
std::move(query_handler.on_suggestions_returned_)
- .Run(query_handler.field_id_, query_handler.trigger_source_, suggestions);
+ .Run(query_handler.field_id_, suggestions);
}
void AutocompleteHistoryManager::CancelAllPendingQueries() {
diff --git a/components/autofill/core/browser/autocomplete_history_manager.h b/components/autofill/core/browser/autocomplete_history_manager.h
index f5ef98e..5ccef697 100644
--- a/components/autofill/core/browser/autocomplete_history_manager.h
+++ b/components/autofill/core/browser/autocomplete_history_manager.h
@@ -44,7 +44,6 @@
// SingleFieldFormFiller overrides:
[[nodiscard]] bool OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource trigger_source,
const FormFieldData& field,
const AutofillClient& client,
OnSuggestionsReturnedCallback on_suggestions_returned,
@@ -81,7 +80,6 @@
// with the appropriate response.
struct QueryHandler {
QueryHandler(FieldGlobalId field_id,
- AutofillSuggestionTriggerSource trigger_source,
std::u16string prefix,
OnSuggestionsReturnedCallback on_suggestions_returned);
QueryHandler(const QueryHandler&) = delete;
@@ -91,12 +89,6 @@
// The queried field ID.
FieldGlobalId field_id_;
- // Describes what caused the suggestions to trigger. This value was provided
- // by the handler when requesting suggestions. It is temporarily stored
- // while suggestions are queried, so it can be passed on to the
- // `on_suggestions_returned_` callback.
- AutofillSuggestionTriggerSource trigger_source_;
-
// Prefix used to search suggestions, submitted by the handler.
std::u16string prefix_;
diff --git a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
index f699ee6..8dc2935 100644
--- a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
+++ b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
@@ -445,8 +445,8 @@
// Simulate request for suggestions.
EXPECT_FALSE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
}
// Make sure our handler is called at the right time.
@@ -467,14 +467,13 @@
// Simulate request for suggestions.
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Setting up mock to verify that DB response triggers a call to the handler's
// OnSuggestionsReturned
EXPECT_CALL(mock_callback,
Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::Truly(IsEmptySuggestionVector)));
// Simulate response from DB.
@@ -498,16 +497,12 @@
// Simulate request for suggestions.
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Setting up mock to verify that DB response does not trigger a call to the
// handler's OnSuggestionsReturned.
- EXPECT_CALL(
- mock_callback,
- Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked, _))
- .Times(0);
+ EXPECT_CALL(mock_callback, Run(test_field_.global_id(), _)).Times(0);
}
// Tests that no suggestions are queried if the field name is filtered because
@@ -526,16 +521,12 @@
// Simulate request for suggestions.
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Setting up mock to verify that DB response does not trigger a call to the
// handler's OnSuggestionsReturned.
- EXPECT_CALL(
- mock_callback,
- Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked, _))
- .Times(0);
+ EXPECT_CALL(mock_callback, Run(test_field_.global_id(), _)).Times(0);
}
// Tests that the suggestions are queried if the field has meaningless substring
@@ -560,14 +551,11 @@
// Simulate request for suggestions.
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Setting up mock to verify that DB response triggers a call to the handler's
- EXPECT_CALL(
- mock_callback,
- Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked, _));
+ EXPECT_CALL(mock_callback, Run(test_field_.global_id(), _));
autocomplete_manager_->OnWebDataServiceRequestDone(mocked_db_query_id,
std::move(mocked_results));
@@ -594,19 +582,17 @@
// Simulate request for suggestions.
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Setting up mock to verify that DB response triggers a call to the handler's
- EXPECT_CALL(
- mock_callback,
- Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked, _));
+ EXPECT_CALL(mock_callback, Run(test_field_.global_id(), _));
autocomplete_manager_->OnWebDataServiceRequestDone(mocked_db_query_id,
std::move(mocked_results));
}
+// Tests that we are correctly returning a suggestion back to the handler.
TEST_F(AutocompleteHistoryManagerTest,
SuggestionsReturned_InvokeHandler_SingleValue) {
int mocked_db_query_id = 100;
@@ -625,50 +611,12 @@
// Simulate request for suggestions.
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Setting up mock to verify that DB response triggers a call to the handler's
EXPECT_CALL(mock_callback,
Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
- UnorderedElementsAre(Field(
- &Suggestion::main_text,
- Suggestion::Text(expected_values[0].key().value(),
- Suggestion::Text::IsPrimary(true))))));
-
- // Simulate response from DB.
- autocomplete_manager_->OnWebDataServiceRequestDone(mocked_db_query_id,
- std::move(mocked_results));
-}
-
-// Tests that we are correctly forwarding the value of the
-// `AutofillSuggestionTriggerSource` back to the handler.
-TEST_F(AutocompleteHistoryManagerTest,
- SuggestionsReturned_InvokeHandler_PassesTriggerSource) {
- int mocked_db_query_id = 100;
-
- std::vector<AutocompleteEntry> expected_values = {
- GetAutocompleteEntry(test_field_.name, u"SomePrefixOne")};
-
- std::unique_ptr<WDTypedResult> mocked_results =
- GetMockedDbResults(expected_values);
-
- EXPECT_CALL(*web_data_service_,
- GetFormValuesForElementName(test_field_.name, test_field_.value,
- _, autocomplete_manager_.get()))
- .WillOnce(Return(mocked_db_query_id));
-
- // Simulate request for suggestions.
- MockSuggestionsReturnedCallback mock_callback;
- EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
-
- // Setting up mock to verify that DB response triggers a call to the handler's
- EXPECT_CALL(mock_callback,
- Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
UnorderedElementsAre(Field(
&Suggestion::main_text,
Suggestion::Text(expected_values[0].key().value(),
@@ -699,13 +647,12 @@
// Simulate request for suggestions.
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Setting up mock to verify that DB response triggers a call to the handler's
EXPECT_CALL(mock_callback,
Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::Truly(IsEmptySuggestionVector)));
// Simulate response from DB.
@@ -733,13 +680,12 @@
// Simulate request for suggestions.
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Setting up mock to verify that DB response triggers a call to the handler's
EXPECT_CALL(mock_callback,
Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
UnorderedElementsAre(Field(
&Suggestion::main_text,
Suggestion::Text(expected_values[0].key().value(),
@@ -782,8 +728,8 @@
// Simulate request for suggestions.
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Simulate response from DB.
autocomplete_manager_->OnWebDataServiceRequestDone(mocked_db_query_id,
@@ -826,21 +772,20 @@
// Simulate request for the first suggestions.
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Simulate request for the second suggestions (this will cancel the first
// one).
EXPECT_CALL(*web_data_service_, CancelRequest(mocked_db_query_id_first))
.Times(1);
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Setting up mock to verify that we can get the second response first.
EXPECT_CALL(mock_callback,
Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
UnorderedElementsAre(Field(
&Suggestion::main_text,
Suggestion::Text(expected_values_second[0].key().value(),
@@ -852,11 +797,7 @@
// Setting up mock to verify that the handler doesn't get called for the first
// request, which was cancelled.
- EXPECT_CALL(
- mock_callback,
- Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked, _))
- .Times(0);
+ EXPECT_CALL(mock_callback, Run(test_field_.global_id(), _)).Times(0);
// Simulate response from DB, first request comes back after.
autocomplete_manager_->OnWebDataServiceRequestDone(
@@ -879,19 +820,15 @@
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ test_field_, autofill_client_, mock_callback.Get(),
+ SuggestionsContext()));
// Simulate cancelling the request.
EXPECT_CALL(*web_data_service_, CancelRequest(mocked_db_query_id));
autocomplete_manager_->CancelPendingQueries();
// Make sure the handler is not called when the DB responds.
- EXPECT_CALL(
- mock_callback,
- Run(test_field_.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked, _))
- .Times(0);
+ EXPECT_CALL(mock_callback, Run(test_field_.global_id(), _)).Times(0);
autocomplete_manager_->OnWebDataServiceRequestDone(
mocked_db_query_id, std::move(mocked_results_one));
}
@@ -909,12 +846,10 @@
MockSuggestionsReturnedCallback mock_callback;
EXPECT_CALL(mock_callback,
Run(field.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::Truly(IsEmptySuggestionVector)));
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, field,
- autofill_client_, mock_callback.Get(), SuggestionsContext()));
+ field, autofill_client_, mock_callback.Get(), SuggestionsContext()));
}
TEST_F(AutocompleteHistoryManagerTest, DestructorCancelsRequests) {
@@ -927,8 +862,7 @@
// Simulate request for suggestions.
EXPECT_TRUE(autocomplete_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, base::DoNothing(), SuggestionsContext()));
+ test_field_, autofill_client_, base::DoNothing(), SuggestionsContext()));
// Expect a cancel call.
EXPECT_CALL(*web_data_service_, CancelRequest(mocked_db_query_id));
diff --git a/components/autofill/core/browser/autofill_external_delegate.cc b/components/autofill/core/browser/autofill_external_delegate.cc
index 3bb6712b..ac37d9c 100644
--- a/components/autofill/core/browser/autofill_external_delegate.cc
+++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -235,9 +235,7 @@
void AutofillExternalDelegate::OnSuggestionsReturned(
FieldGlobalId field_id,
const std::vector<Suggestion>& input_suggestions,
- AutofillSuggestionTriggerSource trigger_source,
bool is_all_server_suggestions) {
- CHECK_EQ(trigger_source, trigger_source_);
// Only include "Autofill Options" special menu item if we have Autofill
// suggestions.
bool has_autofill_suggestions = base::ranges::any_of(
diff --git a/components/autofill/core/browser/autofill_external_delegate.h b/components/autofill/core/browser/autofill_external_delegate.h
index 6bee759..5336acb4 100644
--- a/components/autofill/core/browser/autofill_external_delegate.h
+++ b/components/autofill/core/browser/autofill_external_delegate.h
@@ -94,11 +94,9 @@
// Records query results and correctly formats them before sending them off
// to be displayed. Called when an Autofill query result is available.
- // TODO(crbug.com/1493361): `trigger_source` is unused, remove.
virtual void OnSuggestionsReturned(
FieldGlobalId field_id,
const std::vector<Suggestion>& suggestions,
- AutofillSuggestionTriggerSource trigger_source,
bool is_all_server_suggestions = false);
// Returns the last targeted field types to be filled. This does not
diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
index dc11e932..7c744b9 100644
--- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc
+++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
@@ -311,8 +311,7 @@
std::vector<Suggestion> suggestions;
suggestions.emplace_back();
suggestions[0].popup_item_id = PopupItemId::kAddressEntry;
- external_delegate().OnSuggestionsReturned(field_id, suggestions,
- kDefaultTriggerSource);
+ external_delegate().OnSuggestionsReturned(field_id, suggestions);
}
Matcher<const FormData&> HasQueriedFormId() {
@@ -689,8 +688,8 @@
std::vector<Suggestion> autofill_item = {
Suggestion(PopupItemId::kAddressEntry)};
autofill_item[0].payload = Suggestion::Guid(profile.guid());
- external_delegate().OnSuggestionsReturned(
- queried_form_triggering_field_id_, autofill_item, kDefaultTriggerSource);
+ external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
+ autofill_item);
EXPECT_CALL(manager(), FillOrPreviewProfileForm(
mojom::ActionPersistence::kFill,
@@ -729,8 +728,8 @@
ShowAutofillPopup(PopupOpenArgsAre(kExpectedSuggestions), _));
std::vector<Suggestion> autofill_item;
autofill_item.emplace_back(/*main_text=*/u"", PopupItemId::kAddressEntry);
- external_delegate().OnSuggestionsReturned(
- queried_form_triggering_field_id_, autofill_item, kDefaultTriggerSource);
+ external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
+ autofill_item);
// Try calling OnSuggestionsReturned with no Autofill values and ensure
// the datalist items are still shown.
@@ -740,8 +739,8 @@
PopupOpenArgsAre(SuggestionVectorIdsAre(PopupItemId::kDatalistEntry)),
_));
autofill_item.clear();
- external_delegate().OnSuggestionsReturned(
- queried_form_triggering_field_id_, autofill_item, kDefaultTriggerSource);
+ external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
+ autofill_item);
}
// Test that datalist values can get updated while a popup is showing.
@@ -774,8 +773,8 @@
std::vector<Suggestion> autofill_item;
autofill_item.emplace_back();
autofill_item[0].popup_item_id = PopupItemId::kAddressEntry;
- external_delegate().OnSuggestionsReturned(
- queried_form_triggering_field_id_, autofill_item, kDefaultTriggerSource);
+ external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
+ autofill_item);
// This would normally get called from ShowAutofillPopup, but it is mocked so
// we need to call OnPopupShown ourselves.
@@ -823,8 +822,8 @@
Suggestion::Text(u"Rick", Suggestion::Text::IsPrimary(true));
autofill_item[0].labels = {{Suggestion::Text(u"Deckard")}};
autofill_item[0].popup_item_id = PopupItemId::kAddressEntry;
- external_delegate().OnSuggestionsReturned(
- queried_form_triggering_field_id_, autofill_item, kDefaultTriggerSource);
+ external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
+ autofill_item);
}
// Test that we de-dupe autocomplete values against datalist values, keeping the
@@ -864,8 +863,7 @@
Suggestion::Text(u"Cain", Suggestion::Text::IsPrimary(true));
autocomplete_items[1].popup_item_id = PopupItemId::kAutocompleteEntry;
external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
- autocomplete_items,
- kDefaultTriggerSource);
+ autocomplete_items);
}
// Test that the Autofill popup is able to display warnings explaining why
@@ -883,8 +881,8 @@
autofill_item.emplace_back();
autofill_item[0].popup_item_id =
PopupItemId::kInsecureContextPaymentDisabledMessage;
- external_delegate().OnSuggestionsReturned(
- queried_form_triggering_field_id_, autofill_item, kDefaultTriggerSource);
+ external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
+ autofill_item);
EXPECT_THAT(open_args.suggestions,
SuggestionVectorIdsAre(
@@ -913,7 +911,7 @@
Suggestion::Text(u"Rick", Suggestion::Text::IsPrimary(true));
suggestions[1].popup_item_id = PopupItemId::kAutocompleteEntry;
external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
- suggestions, kDefaultTriggerSource);
+ suggestions);
}
// Test that the Autofill delegate doesn't try and fill a form with a
@@ -954,7 +952,7 @@
suggestions[0].labels = {{Suggestion::Text(u"My doctor's IBAN")}};
suggestions[0].payload = Suggestion::ValueToFill(unmasked_iban_value);
external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
- suggestions, kDefaultTriggerSource);
+ suggestions);
EXPECT_CALL(driver(), RendererShouldClearPreviewedForm());
EXPECT_CALL(manager(),
@@ -992,7 +990,7 @@
suggestions[0].main_text.value = promo_code_value;
suggestions[0].labels = {{Suggestion::Text(u"12.34% off your purchase!")}};
external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
- suggestions, kDefaultTriggerSource);
+ suggestions);
EXPECT_CALL(driver(), RendererShouldClearPreviewedForm());
EXPECT_CALL(manager(),
@@ -1552,7 +1550,7 @@
// This function tests the filling of existing plus addresses, which is why
// `OfferPlusAddressCreation` need not be mocked.
external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
- suggestions, kDefaultTriggerSource);
+ suggestions);
EXPECT_CALL(driver(), RendererShouldClearPreviewedForm());
EXPECT_CALL(
@@ -1599,7 +1597,7 @@
suggestions.emplace_back(/*main_text=*/u"",
PopupItemId::kCreateNewPlusAddress);
external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
- suggestions, kDefaultTriggerSource);
+ suggestions);
EXPECT_CALL(driver(), RendererShouldClearPreviewedForm());
external_delegate().DidSelectSuggestion(suggestions[0],
@@ -1650,7 +1648,7 @@
std::vector<Suggestion> suggestions = {
Suggestion(/*main_text=*/u"", PopupItemId::kCompose)};
external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
- suggestions, kDefaultTriggerSource);
+ suggestions);
// Simulate accepting a Compose suggestion.
AutofillComposeDelegate::ComposeCallback callback;
@@ -1826,8 +1824,7 @@
EXPECT_CALL(client(), ShowAutofillPopup);
EXPECT_CALL(client(), HideAutofillPopup(_)).Times(0);
- external_delegate().OnSuggestionsReturned(field.global_id(), autofill_items,
- kDefaultTriggerSource);
+ external_delegate().OnSuggestionsReturned(field.global_id(), autofill_items);
}
TEST_F(AutofillExternalDelegateUnitTest,
@@ -1952,8 +1949,7 @@
std::vector<Suggestion> autofill_item;
autofill_item.emplace_back(/*main_text=*/u"", PopupItemId::kAddressEntry);
external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
- autofill_item,
- kDefaultTriggerSource, true);
+ autofill_item, true);
}
TEST_F(AutofillExternalDelegateUnitTest,
@@ -1971,8 +1967,7 @@
std::vector<Suggestion> autofill_item;
autofill_item.emplace_back(/*main_text=*/u"", PopupItemId::kAddressEntry);
external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
- autofill_item,
- kDefaultTriggerSource, false);
+ autofill_item, false);
}
TEST_F(AutofillExternalDelegateUnitTest, ShouldUseNewSettingName) {
@@ -1990,8 +1985,8 @@
std::vector<Suggestion> autofill_item;
autofill_item.emplace_back(/*main_text=*/u"", PopupItemId::kAddressEntry);
autofill_item[0].main_text.is_primary = Suggestion::Text::IsPrimary(true);
- external_delegate().OnSuggestionsReturned(
- queried_form_triggering_field_id_, autofill_item, kDefaultTriggerSource);
+ external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
+ autofill_item);
}
// Test that browser autofill manager will handle the unmasking request for the
@@ -2030,8 +2025,7 @@
external_delegate().OnSuggestionsReturned(
queried_form_triggering_field_id_,
- {Suggestion{PopupItemId::kAutocompleteEntry}},
- AutofillSuggestionTriggerSource::kShowPromptAfterDialogClosed);
+ {Suggestion{PopupItemId::kAutocompleteEntry}});
}
// Tests that the prompt to show account cards shows up when the corresponding
@@ -2056,8 +2050,8 @@
std::vector<Suggestion> autofill_item;
autofill_item.emplace_back(/*main_text=*/u"", PopupItemId::kAddressEntry);
autofill_item[0].main_text.is_primary = Suggestion::Text::IsPrimary(true);
- external_delegate().OnSuggestionsReturned(
- queried_form_triggering_field_id_, autofill_item, kDefaultTriggerSource);
+ external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
+ autofill_item);
}
// Tests that the prompt to show account cards shows up when the corresponding
@@ -2074,8 +2068,7 @@
EXPECT_CALL(client(),
ShowAutofillPopup(PopupOpenArgsAre(kExpectedSuggestions), _));
external_delegate().OnSuggestionsReturned(queried_form_triggering_field_id_,
- std::vector<Suggestion>(),
- kDefaultTriggerSource);
+ std::vector<Suggestion>());
}
#if BUILDFLAG(IS_IOS)
@@ -2087,8 +2080,8 @@
client().set_last_queried_field(new_field_id);
IssueOnQuery();
EXPECT_CALL(client(), ShowAutofillPopup).Times(0);
- external_delegate().OnSuggestionsReturned(
- old_field_id, std::vector<Suggestion>(), kDefaultTriggerSource);
+ external_delegate().OnSuggestionsReturned(old_field_id,
+ std::vector<Suggestion>());
}
#endif
diff --git a/components/autofill/core/browser/autofill_test_utils.cc b/components/autofill/core/browser/autofill_test_utils.cc
index 0ac3ca0a..5a04b19 100644
--- a/components/autofill/core/browser/autofill_test_utils.cc
+++ b/components/autofill/core/browser/autofill_test_utils.cc
@@ -846,9 +846,8 @@
std::vector<Suggestion> suggestions;
suggestions.push_back(Suggestion(u"Test suggestion"));
- autofill_external_delegate->OnSuggestionsReturned(
- field.global_id(), suggestions,
- AutofillSuggestionTriggerSource::kFormControlElementClicked);
+ autofill_external_delegate->OnSuggestionsReturned(field.global_id(),
+ suggestions);
}
std::string ObfuscatedCardDigitsAsUTF8(const std::string& str,
diff --git a/components/autofill/core/browser/browser_autofill_manager.cc b/components/autofill/core/browser/browser_autofill_manager.cc
index 55a2ce4..497a72e6 100644
--- a/components/autofill/core/browser/browser_autofill_manager.cc
+++ b/components/autofill/core/browser/browser_autofill_manager.cc
@@ -716,7 +716,6 @@
DCHECK(!cards.empty());
external_delegate_->OnSuggestionsReturned(
field_data.global_id(), cards,
- AutofillSuggestionTriggerSource::kShowCardsFromAccount,
should_display_gpay_logo);
}
@@ -1138,7 +1137,7 @@
case SuppressReason::kAblation:
single_field_form_fill_router_->CancelPendingQueries();
external_delegate_->OnSuggestionsReturned(field.global_id(),
- suggestions, trigger_source);
+ suggestions);
LOG_AF(log_manager())
<< LoggingScope::kFilling << LogMessage::kSuggestionSuppressed
<< " Reason: Ablation experiment";
@@ -1243,15 +1242,14 @@
// TODO(crbug.com/1007974): The callback will only be called once.
bool handled_by_single_field_form_filler =
single_field_form_fill_router_->OnGetSingleFieldSuggestions(
- trigger_source, field, client(),
+ field, client(),
base::BindRepeating(
[](base::WeakPtr<BrowserAutofillManager> self,
FieldGlobalId field_id,
- AutofillSuggestionTriggerSource trigger_source,
const std::vector<Suggestion>& suggestions) {
if (self) {
self->external_delegate_->OnSuggestionsReturned(
- field_id, suggestions, trigger_source);
+ field_id, suggestions);
}
},
weak_ptr_factory_.GetWeakPtr()),
@@ -1289,7 +1287,6 @@
if (show_suggestion) {
// Send Autofill suggestions (could be an empty list).
external_delegate_->OnSuggestionsReturned(field.global_id(), suggestions,
- trigger_source,
context.should_display_gpay_logo);
}
}
diff --git a/components/autofill/core/browser/browser_autofill_manager_unittest.cc b/components/autofill/core/browser/browser_autofill_manager_unittest.cc
index 51d108a..13ead1f 100644
--- a/components/autofill/core/browser/browser_autofill_manager_unittest.cc
+++ b/components/autofill/core/browser/browser_autofill_manager_unittest.cc
@@ -2220,13 +2220,11 @@
// Mock returning some autocomplete `suggestions`.
EXPECT_CALL(*single_field_form_fill_router(), OnGetSingleFieldSuggestions)
- .WillOnce([&](AutofillSuggestionTriggerSource trigger_source,
- const FormFieldData& field, const AutofillClient& client,
+ .WillOnce([&](const FormFieldData& field, const AutofillClient& client,
SingleFieldFormFiller::OnSuggestionsReturnedCallback
on_suggestions_returned,
const SuggestionsContext& context) {
- std::move(on_suggestions_returned)
- .Run(field.global_id(), trigger_source, suggestions);
+ std::move(on_suggestions_returned).Run(field.global_id(), suggestions);
return true;
});
GetAutofillSuggestions(
diff --git a/components/autofill/core/browser/iban_manager.cc b/components/autofill/core/browser/iban_manager.cc
index d5496c1..bb3740e 100644
--- a/components/autofill/core/browser/iban_manager.cc
+++ b/components/autofill/core/browser/iban_manager.cc
@@ -27,7 +27,6 @@
IbanManager::~IbanManager() = default;
bool IbanManager::OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource trigger_source,
const FormFieldData& field,
const AutofillClient& client,
OnSuggestionsReturnedCallback on_suggestions_returned,
@@ -74,7 +73,7 @@
return iban0->HasGreaterRankingThan(iban1, comparison_time);
});
SendIbanSuggestions(std::move(ibans), field,
- std::move(on_suggestions_returned), trigger_source);
+ std::move(on_suggestions_returned));
return true;
}
@@ -118,8 +117,7 @@
void IbanManager::SendIbanSuggestions(
std::vector<const Iban*> ibans,
const FormFieldData& field,
- OnSuggestionsReturnedCallback on_suggestions_returned,
- AutofillSuggestionTriggerSource trigger_source) {
+ OnSuggestionsReturnedCallback on_suggestions_returned) {
// If the input box content equals any of the available IBANs, then
// assume the IBAN has been filled, and don't show any suggestions.
if (!field.value.empty() &&
@@ -134,7 +132,7 @@
}
std::move(on_suggestions_returned)
- .Run(field.global_id(), trigger_source,
+ .Run(field.global_id(),
AutofillSuggestionGenerator::GetSuggestionsForIbans(ibans));
uma_recorder_.OnIbanSuggestionsShown(field.global_id());
diff --git a/components/autofill/core/browser/iban_manager.h b/components/autofill/core/browser/iban_manager.h
index d299634..414621c 100644
--- a/components/autofill/core/browser/iban_manager.h
+++ b/components/autofill/core/browser/iban_manager.h
@@ -39,7 +39,6 @@
// SingleFieldFormFiller overrides:
[[nodiscard]] bool OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource trigger_source,
const FormFieldData& field,
const AutofillClient& client,
OnSuggestionsReturnedCallback on_suggestions_returned,
@@ -77,8 +76,7 @@
void SendIbanSuggestions(
std::vector<const Iban*> ibans,
const FormFieldData& field,
- OnSuggestionsReturnedCallback on_suggestions_returned,
- AutofillSuggestionTriggerSource trigger_source);
+ OnSuggestionsReturnedCallback on_suggestions_returned);
// Filter out IBAN-based suggestions based on the following criteria:
// For local IBANs: Filter out the IBAN value which does not starts with the
diff --git a/components/autofill/core/browser/iban_manager_unittest.cc b/components/autofill/core/browser/iban_manager_unittest.cc
index 1728a5f..dd206f31 100644
--- a/components/autofill/core/browser/iban_manager_unittest.cc
+++ b/components/autofill/core/browser/iban_manager_unittest.cc
@@ -165,7 +165,6 @@
MockSuggestionsReturnedCallback mock_callback;
EXPECT_CALL(mock_callback,
Run(test_field.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::UnorderedElementsAre(
MatchesTextAndPopupItemId(local_iban_suggestion_0),
MatchesTextAndPopupItemId(local_iban_suggestion_1),
@@ -178,8 +177,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
TEST_F(IbanManagerTest, PaymentsAutofillEnabledPrefOff_NoIbanSuggestionsShown) {
@@ -196,8 +194,7 @@
// Because the "Save and autofill payment methods" toggle is off, the
// suggestion handler should not be triggered.
EXPECT_FALSE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
TEST_F(IbanManagerTest, IbanSuggestions_SeparatorAndFooter) {
@@ -215,7 +212,6 @@
MockSuggestionsReturnedCallback mock_callback;
EXPECT_CALL(mock_callback,
Run(test_field.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::UnorderedElementsAre(
MatchesTextAndPopupItemId(iban_suggestion_0),
MatchesTextAndPopupItemId(iban_suggestion_1),
@@ -225,8 +221,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
TEST_F(IbanManagerTest,
@@ -249,8 +244,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
TEST_F(IbanManagerTest,
@@ -273,7 +267,6 @@
MockSuggestionsReturnedCallback mock_callback;
EXPECT_CALL(mock_callback,
Run(test_field.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::UnorderedElementsAre(
MatchesTextAndPopupItemId(iban_suggestion_0),
MatchesTextAndPopupItemId(iban_suggestion_1),
@@ -284,8 +277,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
test_field.value = u"CH5604";
@@ -295,7 +287,6 @@
// there are one separator and one footer suggestion displayed.
EXPECT_CALL(mock_callback,
Run(test_field.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::UnorderedElementsAre(
MatchesTextAndPopupItemId(iban_suggestion_0),
MatchesTextAndPopupItemId(iban_suggestion_2),
@@ -305,8 +296,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
test_field.value = u"AB56";
@@ -318,8 +308,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
// Test that when the input text field is shorter than IBAN's prefix, all IBANs
@@ -348,7 +337,6 @@
MockSuggestionsReturnedCallback mock_callback;
EXPECT_CALL(mock_callback,
Run(test_field.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::UnorderedElementsAre(
MatchesTextAndPopupItemId(server_iban_suggestion_0),
MatchesTextAndPopupItemId(server_iban_suggestion_1),
@@ -359,8 +347,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
// Test that when the input text field is shorter than IBAN's prefix, only IBANs
@@ -389,7 +376,6 @@
MockSuggestionsReturnedCallback mock_callback;
EXPECT_CALL(mock_callback,
Run(test_field.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::UnorderedElementsAre(
MatchesTextAndPopupItemId(server_iban_suggestion_0),
MatchesTextAndPopupItemId(separator_suggestion),
@@ -399,8 +385,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
// Test that when there is no prefix present, all server IBANs should be
@@ -430,7 +415,6 @@
MockSuggestionsReturnedCallback mock_callback;
EXPECT_CALL(mock_callback,
Run(test_field.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::UnorderedElementsAre(
MatchesTextAndPopupItemId(server_iban_suggestion_0),
MatchesTextAndPopupItemId(server_iban_suggestion_1),
@@ -442,8 +426,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
test_field.value = u"AB567";
@@ -451,7 +434,6 @@
// character is less than `kFieldLengthLimitOnServerIbanSuggestion`.
EXPECT_CALL(mock_callback,
Run(test_field.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::UnorderedElementsAre(
MatchesTextAndPopupItemId(server_iban_suggestion_0),
MatchesTextAndPopupItemId(server_iban_suggestion_1),
@@ -463,8 +445,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
// Test that when there is no prefix present, no server IBANs should be
@@ -500,8 +481,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
TEST_F(IbanManagerTest, DoesNotShowIbansForBlockedWebsite) {
@@ -520,8 +500,7 @@
// Simulate request for suggestions.
EXPECT_FALSE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
// Test that suggestions are returned on platforms that don't have an
@@ -541,7 +520,6 @@
MockSuggestionsReturnedCallback mock_callback;
EXPECT_CALL(mock_callback,
Run(test_field.global_id(),
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
testing::IsSupersetOf(
{MatchesTextAndPopupItemId(iban_suggestion_0)})));
@@ -549,8 +527,7 @@
// Because all criteria are met to trigger returning to the handler,
// the handler should be triggered and this should return true.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
TEST_F(IbanManagerTest, NotIbanFieldFocused_NoSuggestionsShown) {
@@ -569,8 +546,7 @@
// Simulate request for suggestions.
EXPECT_FALSE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
}
// Tests that when showing IBAN suggestions is allowed by the site-specific
@@ -585,8 +561,7 @@
// Simulate request for suggestions.
// TODO: handle return value.
std::ignore = iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, base::DoNothing(), context);
+ test_field, autofill_client_, base::DoNothing(), context);
histogram_tester.ExpectUniqueSample(
"Autofill.Iban.ShowSuggestionsBlocklistDecision",
@@ -612,8 +587,7 @@
// Simulate request for suggestions.
// TODO: handle return value.
std::ignore = iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(),
+ test_field, autofill_client_, mock_callback.Get(),
/*context=*/context);
histogram_tester.ExpectUniqueSample(
@@ -634,8 +608,7 @@
// Simulate request for suggestions.
// TODO: handle return value.
std::ignore = iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, base::DoNothing(),
+ test_field, autofill_client_, base::DoNothing(),
/*context=*/context);
histogram_tester.ExpectUniqueSample(
@@ -657,12 +630,10 @@
// Simulate request for suggestions.
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
EXPECT_THAT(
histogram_tester.GetAllSamples("Autofill.Iban.Suggestions"),
@@ -689,8 +660,7 @@
// Simulate request for suggestions and select one suggested IBAN.
MockSuggestionsReturnedCallback mock_callback;
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
iban_manager_.OnSingleFieldSuggestionSelected(u"", PopupItemId::kIbanEntry);
histogram_tester.ExpectBucketCount(
@@ -701,8 +671,7 @@
autofill_metrics::IbanSuggestionsEvent::kIbanSuggestionSelectedOnce, 1);
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
iban_manager_.OnSingleFieldSuggestionSelected(u"", PopupItemId::kIbanEntry);
histogram_tester.ExpectBucketCount(
@@ -729,8 +698,7 @@
// The suggestion handler should be triggered as some IBANs are available.
// However, no suggestions are returned due to the prefix match requirement.
EXPECT_TRUE(iban_manager_.OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field,
- autofill_client_, mock_callback.Get(), context));
+ test_field, autofill_client_, mock_callback.Get(), context));
EXPECT_THAT(
histogram_tester.GetAllSamples("Autofill.Iban.Suggestions"),
BucketsAre(
diff --git a/components/autofill/core/browser/merchant_promo_code_manager.cc b/components/autofill/core/browser/merchant_promo_code_manager.cc
index 71b1404..64fe47f9 100644
--- a/components/autofill/core/browser/merchant_promo_code_manager.cc
+++ b/components/autofill/core/browser/merchant_promo_code_manager.cc
@@ -19,7 +19,6 @@
MerchantPromoCodeManager::~MerchantPromoCodeManager() = default;
bool MerchantPromoCodeManager::OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource trigger_source,
const FormFieldData& field,
const AutofillClient& client,
OnSuggestionsReturnedCallback on_suggestions_returned,
@@ -39,8 +38,7 @@
context.form_structure->main_frame_origin().GetURL());
if (!promo_code_offers.empty()) {
SendPromoCodeSuggestions(std::move(promo_code_offers), field,
- std::move(on_suggestions_returned),
- trigger_source);
+ std::move(on_suggestions_returned));
return true;
}
}
@@ -147,20 +145,18 @@
void MerchantPromoCodeManager::SendPromoCodeSuggestions(
std::vector<const AutofillOfferData*> promo_code_offers,
const FormFieldData& field,
- OnSuggestionsReturnedCallback on_suggestions_returned,
- AutofillSuggestionTriggerSource trigger_source) {
+ OnSuggestionsReturnedCallback on_suggestions_returned) {
// If the input box content equals any of the available promo codes, then
// assume the promo code has been filled, and don't show any suggestions.
for (const AutofillOfferData* promo_code_offer : promo_code_offers) {
if (field.value == base::ASCIIToUTF16(promo_code_offer->GetPromoCode())) {
- std::move(on_suggestions_returned)
- .Run(field.global_id(), trigger_source, {});
+ std::move(on_suggestions_returned).Run(field.global_id(), {});
return;
}
}
std::move(on_suggestions_returned)
- .Run(field.global_id(), trigger_source,
+ .Run(field.global_id(),
AutofillSuggestionGenerator::
GetPromoCodeSuggestionsFromPromoCodeOffers(promo_code_offers));
diff --git a/components/autofill/core/browser/merchant_promo_code_manager.h b/components/autofill/core/browser/merchant_promo_code_manager.h
index c5586a5..f367961 100644
--- a/components/autofill/core/browser/merchant_promo_code_manager.h
+++ b/components/autofill/core/browser/merchant_promo_code_manager.h
@@ -36,7 +36,6 @@
// SingleFieldFormFiller overrides:
[[nodiscard]] bool OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource trigger_source,
const FormFieldData& field,
const AutofillClient& client,
OnSuggestionsReturnedCallback on_suggestions_returned,
@@ -100,8 +99,7 @@
void SendPromoCodeSuggestions(
std::vector<const AutofillOfferData*> promo_code_offers,
const FormFieldData& field,
- OnSuggestionsReturnedCallback on_suggestions_returned,
- AutofillSuggestionTriggerSource trigger_source);
+ OnSuggestionsReturnedCallback on_suggestions_returned);
raw_ptr<PersonalDataManager> personal_data_manager_ = nullptr;
diff --git a/components/autofill/core/browser/merchant_promo_code_manager_unittest.cc b/components/autofill/core/browser/merchant_promo_code_manager_unittest.cc
index 3e26809..e6cba41 100644
--- a/components/autofill/core/browser/merchant_promo_code_manager_unittest.cc
+++ b/components/autofill/core/browser/merchant_promo_code_manager_unittest.cc
@@ -86,8 +86,6 @@
TEST_F(MerchantPromoCodeManagerTest, ShowsPromoCodeSuggestions) {
base::HistogramTester histogram_tester;
- const auto trigger_source =
- AutofillSuggestionTriggerSource::kFormControlElementClicked;
std::string last_committed_origin_url = "https://www.example.com";
FormData form_data;
form_data.main_frame_origin =
@@ -107,11 +105,10 @@
MockSuggestionsReturnedCallback mock_callback;
EXPECT_CALL(
mock_callback,
- Run(_, trigger_source,
- UnorderedElementsAre(
- Field(&Suggestion::main_text, promo_code_suggestion.main_text),
- Field(&Suggestion::popup_item_id, PopupItemId::kSeparator),
- Field(&Suggestion::main_text, footer_suggestion.main_text))))
+ Run(_, UnorderedElementsAre(
+ Field(&Suggestion::main_text, promo_code_suggestion.main_text),
+ Field(&Suggestion::popup_item_id, PopupItemId::kSeparator),
+ Field(&Suggestion::main_text, footer_suggestion.main_text))))
.Times(3);
// Simulate request for suggestions.
@@ -119,13 +116,13 @@
// merchant site will be displayed instead of requesting Autocomplete
// suggestions.
EXPECT_TRUE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- trigger_source, test_field_, autofill_client_, mock_callback.Get(),
+ test_field_, autofill_client_, mock_callback.Get(),
/*context=*/context));
// Trigger offers suggestions popup again to be able to test that we do not
// log metrics twice for the same field.
EXPECT_TRUE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- trigger_source, test_field_, autofill_client_, mock_callback.Get(),
+ test_field_, autofill_client_, mock_callback.Get(),
/*context=*/context));
// Trigger offers suggestions popup again to be able to test that we log
@@ -134,7 +131,7 @@
CreateTestFormField(/*label=*/"", "Some Other Name", "SomePrefix",
FormControlType::kInputTelephone);
EXPECT_TRUE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- trigger_source, other_field, autofill_client_, mock_callback.Get(),
+ other_field, autofill_client_, mock_callback.Get(),
/*context=*/context));
histogram_tester.ExpectBucketCount(
@@ -165,8 +162,7 @@
// Simulate request for suggestions.
EXPECT_FALSE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(),
+ test_field_, autofill_client_, mock_callback.Get(),
/*context=*/SuggestionsContext()));
// Ensure that no metrics were logged.
@@ -210,8 +206,7 @@
// Simulate request for suggestions.
EXPECT_FALSE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(),
+ test_field_, autofill_client_, mock_callback.Get(),
/*context=*/context));
// Ensure that no metrics were logged.
@@ -253,8 +248,7 @@
// Simulate request for suggestions.
EXPECT_FALSE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(),
+ test_field_, autofill_client_, mock_callback.Get(),
/*context=*/context));
// Ensure that no metrics were logged.
@@ -296,8 +290,7 @@
// Simulate request for suggestions.
EXPECT_FALSE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(),
+ test_field_, autofill_client_, mock_callback.Get(),
/*context=*/context));
// Ensure that no metrics were logged.
@@ -343,8 +336,7 @@
// Simulate request for suggestions.
EXPECT_FALSE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(),
+ test_field_, autofill_client_, mock_callback.Get(),
/*context=*/context));
// Ensure that no metrics were logged.
@@ -390,8 +382,7 @@
// Simulate request for suggestions.
EXPECT_FALSE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(),
+ test_field_, autofill_client_, mock_callback.Get(),
/*context=*/context));
// Ensure that no metrics were logged.
@@ -431,17 +422,16 @@
// The field contains the promo code already, so check that we do not return
// suggestions to the handler.
MockSuggestionsReturnedCallback mock_callback;
- EXPECT_CALL(mock_callback,
- Run(_, _,
- testing::Truly(
- [](const std::vector<Suggestion>& returned_suggestions) {
- return returned_suggestions.empty();
- })));
+ EXPECT_CALL(
+ mock_callback,
+ Run(_, testing::Truly(
+ [](const std::vector<Suggestion>& returned_suggestions) {
+ return returned_suggestions.empty();
+ })));
// Simulate request for suggestions.
EXPECT_TRUE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, mock_callback.Get(),
+ test_field_, autofill_client_, mock_callback.Get(),
/*context=*/context));
// No metrics should be logged because no suggestions were shown.
@@ -468,8 +458,6 @@
// Set up the test.
base::HistogramTester histogram_tester;
std::u16string test_promo_code = u"test_promo_code";
- const auto trigger_source =
- AutofillSuggestionTriggerSource::kFormControlElementClicked;
std::string last_committed_origin_url = "https://www.example.com";
FormData form_data;
form_data.main_frame_origin =
@@ -491,7 +479,7 @@
// Simulate showing the promo code offers suggestions popup.
EXPECT_TRUE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- trigger_source, test_field_, autofill_client_, base::DoNothing(),
+ test_field_, autofill_client_, base::DoNothing(),
/*context=*/context));
// Simulate selecting a promo code offer suggestion.
@@ -509,7 +497,7 @@
// Simulate showing the promo code offers suggestions popup.
EXPECT_TRUE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- trigger_source, test_field_, autofill_client_, base::DoNothing(),
+ test_field_, autofill_client_, base::DoNothing(),
/*context=*/context));
// Simulate selecting a promo code offer suggestion.
@@ -531,8 +519,6 @@
// Set up the test.
base::HistogramTester histogram_tester;
std::u16string test_promo_code = u"test_promo_code";
- const auto trigger_source =
- AutofillSuggestionTriggerSource::kFormControlElementClicked;
std::string last_committed_origin_url = "https://www.example.com";
FormData form_data;
form_data.main_frame_origin =
@@ -556,7 +542,7 @@
// Simulate showing the promo code offers suggestions popup.
EXPECT_TRUE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- trigger_source, test_field_, autofill_client_, base::DoNothing(),
+ test_field_, autofill_client_, base::DoNothing(),
/*context=*/context));
// Simulate selecting a promo code offer suggestion.
@@ -577,7 +563,7 @@
// Simulate showing the promo code offers suggestions popup.
EXPECT_TRUE(merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- trigger_source, test_field_, autofill_client_, base::DoNothing(),
+ test_field_, autofill_client_, base::DoNothing(),
/*context=*/context));
// Simulate selecting a promo code offer suggestion.
diff --git a/components/autofill/core/browser/mock_autocomplete_history_manager.h b/components/autofill/core/browser/mock_autocomplete_history_manager.h
index fa5d5b4..f743c04 100644
--- a/components/autofill/core/browser/mock_autocomplete_history_manager.h
+++ b/components/autofill/core/browser/mock_autocomplete_history_manager.h
@@ -18,8 +18,7 @@
MOCK_METHOD(bool,
OnGetSingleFieldSuggestions,
- (AutofillSuggestionTriggerSource trigger_source,
- const FormFieldData& field,
+ (const FormFieldData& field,
const AutofillClient& client,
SingleFieldFormFiller::OnSuggestionsReturnedCallback callback,
const SuggestionsContext& context),
diff --git a/components/autofill/core/browser/mock_iban_manager.h b/components/autofill/core/browser/mock_iban_manager.h
index fd9d2ce..156e1e9 100644
--- a/components/autofill/core/browser/mock_iban_manager.h
+++ b/components/autofill/core/browser/mock_iban_manager.h
@@ -21,8 +21,7 @@
MOCK_METHOD(bool,
OnGetSingleFieldSuggestions,
- (AutofillSuggestionTriggerSource trigger_source,
- const FormFieldData& field,
+ (const FormFieldData& field,
const AutofillClient& client,
SingleFieldFormFiller::OnSuggestionsReturnedCallback callback,
const SuggestionsContext& context),
diff --git a/components/autofill/core/browser/mock_merchant_promo_code_manager.h b/components/autofill/core/browser/mock_merchant_promo_code_manager.h
index 8954490..51dd8554 100644
--- a/components/autofill/core/browser/mock_merchant_promo_code_manager.h
+++ b/components/autofill/core/browser/mock_merchant_promo_code_manager.h
@@ -18,8 +18,7 @@
MOCK_METHOD(bool,
OnGetSingleFieldSuggestions,
- (AutofillSuggestionTriggerSource trigger_source,
- const FormFieldData& field,
+ (const FormFieldData& field,
const AutofillClient& client,
SingleFieldFormFiller::OnSuggestionsReturnedCallback callback,
const SuggestionsContext& context),
diff --git a/components/autofill/core/browser/mock_single_field_form_fill_router.h b/components/autofill/core/browser/mock_single_field_form_fill_router.h
index 8aa6cd1..cbf95b35 100644
--- a/components/autofill/core/browser/mock_single_field_form_fill_router.h
+++ b/components/autofill/core/browser/mock_single_field_form_fill_router.h
@@ -29,8 +29,7 @@
(override));
MOCK_METHOD(bool,
OnGetSingleFieldSuggestions,
- (AutofillSuggestionTriggerSource trigger_source,
- const FormFieldData& field,
+ (const FormFieldData& field,
const AutofillClient& client,
SingleFieldFormFiller::OnSuggestionsReturnedCallback callback,
const SuggestionsContext& context),
diff --git a/components/autofill/core/browser/single_field_form_fill_router.cc b/components/autofill/core/browser/single_field_form_fill_router.cc
index 29ebea5..f0f7bc3 100644
--- a/components/autofill/core/browser/single_field_form_fill_router.cc
+++ b/components/autofill/core/browser/single_field_form_fill_router.cc
@@ -62,7 +62,6 @@
}
bool SingleFieldFormFillRouter::OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource trigger_source,
const FormFieldData& field,
const AutofillClient& client,
OnSuggestionsReturnedCallback on_suggestions_returned,
@@ -70,17 +69,15 @@
// Retrieving suggestions for a new field; select the appropriate filler.
if (merchant_promo_code_manager_ &&
merchant_promo_code_manager_->OnGetSingleFieldSuggestions(
- trigger_source, field, client, on_suggestions_returned, context)) {
+ field, client, on_suggestions_returned, context)) {
return true;
}
- if (iban_manager_ &&
- iban_manager_->OnGetSingleFieldSuggestions(
- trigger_source, field, client, on_suggestions_returned, context)) {
+ if (iban_manager_ && iban_manager_->OnGetSingleFieldSuggestions(
+ field, client, on_suggestions_returned, context)) {
return true;
}
return autocomplete_history_manager_->OnGetSingleFieldSuggestions(
- trigger_source, field, client, std::move(on_suggestions_returned),
- context);
+ field, client, std::move(on_suggestions_returned), context);
}
void SingleFieldFormFillRouter::OnWillSubmitFormWithFields(
diff --git a/components/autofill/core/browser/single_field_form_fill_router.h b/components/autofill/core/browser/single_field_form_fill_router.h
index 0421d06..3517a449 100644
--- a/components/autofill/core/browser/single_field_form_fill_router.h
+++ b/components/autofill/core/browser/single_field_form_fill_router.h
@@ -46,7 +46,6 @@
// SingleFieldFormFiller overrides:
[[nodiscard]] bool OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource trigger_source,
const FormFieldData& field,
const AutofillClient& client,
OnSuggestionsReturnedCallback on_suggestions_returned,
diff --git a/components/autofill/core/browser/single_field_form_fill_router_unittest.cc b/components/autofill/core/browser/single_field_form_fill_router_unittest.cc
index 73e904bb..2ccb196 100644
--- a/components/autofill/core/browser/single_field_form_fill_router_unittest.cc
+++ b/components/autofill/core/browser/single_field_form_fill_router_unittest.cc
@@ -101,7 +101,6 @@
EXPECT_EQ(test_field_.should_autocomplete,
single_field_form_fill_router_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
test_field_, autofill_client_, base::DoNothing(),
/*context=*/SuggestionsContext()));
}
@@ -224,7 +223,6 @@
.WillOnce(testing::Return(true));
EXPECT_TRUE(single_field_form_fill_router_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked,
test_field_, autofill_client_, base::DoNothing(),
SuggestionsContext()));
}
@@ -247,8 +245,7 @@
// autocomplete. SingleFieldFormFillRouter::OnGetSingleFieldSuggestions()
// should return true.
EXPECT_TRUE(single_field_form_fill_router_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, base::DoNothing(), SuggestionsContext()));
+ test_field_, autofill_client_, base::DoNothing(), SuggestionsContext()));
}
// Ensure that the router routes to AutocompleteHistoryManager for this
@@ -272,8 +269,7 @@
// autocomplete. SingleFieldFormFillRouter::OnGetSingleFieldSuggestions()
// should return true.
EXPECT_TRUE(single_field_form_fill_router_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, base::DoNothing(), SuggestionsContext()));
+ test_field_, autofill_client_, base::DoNothing(), SuggestionsContext()));
}
// Ensure that the router routes to MerchantPromoCodeManager for this
@@ -314,8 +310,7 @@
// All SingleFieldFormFillers returned false, so we should return false as we
// did not attempt to display any single field form fill suggestions.
EXPECT_FALSE(single_field_form_fill_router_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, base::DoNothing(), SuggestionsContext()));
+ test_field_, autofill_client_, base::DoNothing(), SuggestionsContext()));
}
// Ensure that the router routes to AutocompleteHistoryManager for this
@@ -335,8 +330,7 @@
// autocomplete. SingleFieldFormFillRouter::OnGetSingleFieldSuggestions()
// should return true.
EXPECT_TRUE(single_field_form_fill_router_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, base::DoNothing(), SuggestionsContext()));
+ test_field_, autofill_client_, base::DoNothing(), SuggestionsContext()));
}
// Ensure that the router routes to AutocompleteHistoryManager for this
@@ -360,8 +354,7 @@
// autocomplete. SingleFieldFormFillRouter::OnGetSingleFieldSuggestions()
// should return true.
EXPECT_TRUE(single_field_form_fill_router_->OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource::kFormControlElementClicked, test_field_,
- autofill_client_, base::DoNothing(), SuggestionsContext()));
+ test_field_, autofill_client_, base::DoNothing(), SuggestionsContext()));
}
// Ensure that the router routes to IbanManager for this
diff --git a/components/autofill/core/browser/single_field_form_filler.h b/components/autofill/core/browser/single_field_form_filler.h
index b84cd4ad..e90ae73f 100644
--- a/components/autofill/core/browser/single_field_form_filler.h
+++ b/components/autofill/core/browser/single_field_form_filler.h
@@ -31,7 +31,6 @@
// only one of them will end up calling it).
using OnSuggestionsReturnedCallback =
base::RepeatingCallback<void(FieldGlobalId,
- AutofillSuggestionTriggerSource,
const std::vector<Suggestion>&)>;
SingleFieldFormFiller();
@@ -56,7 +55,6 @@
// SingleFieldFormFillers to offer filling the field. The callback can happen
// synchronously even before OnGetSingleFieldSuggestions returns true.
[[nodiscard]] virtual bool OnGetSingleFieldSuggestions(
- AutofillSuggestionTriggerSource trigger_source,
const FormFieldData& field,
const AutofillClient& client,
OnSuggestionsReturnedCallback on_suggestions_returned,
diff --git a/components/autofill/core/browser/test_autofill_external_delegate.cc b/components/autofill/core/browser/test_autofill_external_delegate.cc
index b17de0f9..b8349b59 100644
--- a/components/autofill/core/browser/test_autofill_external_delegate.cc
+++ b/components/autofill/core/browser/test_autofill_external_delegate.cc
@@ -49,7 +49,6 @@
void TestAutofillExternalDelegate::OnSuggestionsReturned(
FieldGlobalId field_id,
const std::vector<Suggestion>& suggestions,
- AutofillSuggestionTriggerSource trigger_source,
bool is_all_server_suggestions) {
on_suggestions_returned_seen_ = true;
field_id_ = field_id;
@@ -59,8 +58,8 @@
// If necessary, call the superclass's OnSuggestionsReturned in order to
// execute logic relating to showing the popup or not.
if (call_parent_methods_)
- AutofillExternalDelegate::OnSuggestionsReturned(
- field_id, suggestions, trigger_source_, is_all_server_suggestions);
+ AutofillExternalDelegate::OnSuggestionsReturned(field_id, suggestions,
+ is_all_server_suggestions);
}
bool TestAutofillExternalDelegate::HasActiveScreenReader() const {
diff --git a/components/autofill/core/browser/test_autofill_external_delegate.h b/components/autofill/core/browser/test_autofill_external_delegate.h
index 6b25fe44..589c02ca 100644
--- a/components/autofill/core/browser/test_autofill_external_delegate.h
+++ b/components/autofill/core/browser/test_autofill_external_delegate.h
@@ -33,7 +33,6 @@
AutofillSuggestionTriggerSource trigger_source) override;
void OnSuggestionsReturned(FieldGlobalId field_id,
const std::vector<Suggestion>& suggestions,
- AutofillSuggestionTriggerSource trigger_source,
bool is_all_server_suggestions) override;
bool HasActiveScreenReader() const override;
void OnAutofillAvailabilityEvent(