Commit 8ac2ad29 authored by estade's avatar estade Committed by Commit bot

Remove dead code in Autofill.

This line can't be reached because it's already guarded by a check to IsAutofillable().

Also, change a method signature to take a const ref.

BUG=none

Review URL: https://codereview.chromium.org/512993002

Cr-Commit-Position: refs/heads/master@{#292724}
parent 367d7dd6
......@@ -465,7 +465,7 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
field, type, &values, &labels, &icons, &unique_ids);
} else {
GetProfileSuggestions(
form_structure, field, type, &values, &labels, &icons, &unique_ids);
*form_structure, field, type, &values, &labels, &icons, &unique_ids);
}
DCHECK_EQ(values.size(), labels.size());
......@@ -477,9 +477,7 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
// provide credit card suggestions for non-HTTPS pages. However, provide a
// warning to the user in these cases.
int warning = 0;
if (!form_structure->IsAutofillable())
warning = IDS_AUTOFILL_WARNING_FORM_DISABLED;
else if (is_filling_credit_card && !FormIsHTTPS(*form_structure))
if (is_filling_credit_card && !FormIsHTTPS(*form_structure))
warning = IDS_AUTOFILL_WARNING_INSECURE_CONNECTION;
if (warning) {
values.assign(1, l10n_util::GetStringUTF16(warning));
......@@ -1074,16 +1072,16 @@ bool AutofillManager::UpdateCachedForm(const FormData& live_form,
}
void AutofillManager::GetProfileSuggestions(
FormStructure* form,
const FormStructure& form,
const FormFieldData& field,
const AutofillType& type,
std::vector<base::string16>* values,
std::vector<base::string16>* labels,
std::vector<base::string16>* icons,
std::vector<int>* unique_ids) const {
std::vector<ServerFieldType> field_types(form->field_count());
for (size_t i = 0; i < form->field_count(); ++i) {
field_types.push_back(form->field(i)->Type().GetStorableType());
std::vector<ServerFieldType> field_types(form.field_count());
for (size_t i = 0; i < form.field_count(); ++i) {
field_types.push_back(form.field(i)->Type().GetStorableType());
}
std::vector<GUIDPair> guid_pairs;
......
......@@ -255,7 +255,7 @@ class AutofillManager : public AutofillDownloadManager::Observer {
// Returns a list of values from the stored profiles that match |type| and the
// value of |field| and returns the labels of the matching profiles. |labels|
// is filled with the Profile label.
void GetProfileSuggestions(FormStructure* form,
void GetProfileSuggestions(const FormStructure& form,
const FormFieldData& field,
const AutofillType& type,
std::vector<base::string16>* values,
......
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