Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: components/autofill/core/browser/autofill_manager.cc

Issue 18563002: Move SendAutofillTypePredictions() into AutofillDriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 7acb75f1f766bfc1a46b0e8fa8682e86eab52f64..7912bb892d2412c8ab7e87cbf9be1e7c97cd4031 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -776,7 +776,7 @@ void AutofillManager::OnLoadedServerPredictions(
#endif // #if defined(TOOLKIT_VIEWS)
// If the corresponding flag is set, annotate forms with the predicted types.
- SendAutofillTypePredictions(form_structures_.get());
+ driver_->SendAutofillTypePredictionsToRenderer(form_structures_.get());
}
void AutofillManager::OnDidEndTextFieldEditing() {
@@ -803,23 +803,6 @@ bool AutofillManager::IsAutofillEnabled() const {
return manager_delegate_->GetPrefs()->GetBoolean(prefs::kAutofillEnabled);
}
-void AutofillManager::SendAutofillTypePredictions(
- const std::vector<FormStructure*>& forms) const {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kShowAutofillTypePredictions))
- return;
-
- RenderViewHost* host = driver_->GetWebContents()->GetRenderViewHost();
- if (!host)
- return;
-
- std::vector<FormDataPredictions> type_predictions;
- FormStructure::GetFieldTypePredictions(forms, &type_predictions);
- host->Send(
- new AutofillMsg_FieldTypePredictionsAvailable(host->GetRoutingID(),
- type_predictions));
-}
-
void AutofillManager::ImportFormData(const FormStructure& submitted_form) {
const CreditCard* imported_credit_card;
if (!personal_data_->ImportFormData(submitted_form, &imported_credit_card))
@@ -1100,7 +1083,7 @@ bool AutofillManager::UpdateCachedForm(const FormData& live_form,
// Annotate the updated form with its predicted types.
std::vector<FormStructure*> forms(1, *updated_form);
- SendAutofillTypePredictions(forms);
+ driver_->SendAutofillTypePredictionsToRenderer(forms);
return true;
}
@@ -1189,7 +1172,7 @@ void AutofillManager::ParseForms(const std::vector<FormData>& forms) {
// For the |non_queryable_forms|, we have all the field type info we're ever
// going to get about them. For the other forms, we'll wait until we get a
// response from the server.
- SendAutofillTypePredictions(non_queryable_forms);
+ driver_->SendAutofillTypePredictionsToRenderer(non_queryable_forms);
}
int AutofillManager::GUIDToID(const GUIDPair& guid) const {
« no previous file with comments | « components/autofill/core/browser/autofill_manager.h ('k') | components/autofill/core/browser/test_autofill_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698