summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorestade <estade@chromium.org>2014-08-29 17:00:11 -0700
committerCommit bot <commit-bot@chromium.org>2014-08-30 00:06:14 +0000
commit8ac2ad2945de828afa49435357d5c4f1f59f4387 (patch)
treeb1eea791b5ed65120b8734bafc276c071c34fe65 /components
parent367d7dd63fb48978cf28918397a8269f368e6f27 (diff)
downloadchromium_src-8ac2ad2945de828afa49435357d5c4f1f59f4387.zip
chromium_src-8ac2ad2945de828afa49435357d5c4f1f59f4387.tar.gz
chromium_src-8ac2ad2945de828afa49435357d5c4f1f59f4387.tar.bz2
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}
Diffstat (limited to 'components')
-rw-r--r--components/autofill/core/browser/autofill_manager.cc14
-rw-r--r--components/autofill/core/browser/autofill_manager.h2
2 files changed, 7 insertions, 9 deletions
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 80409de..76215f3 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -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;
diff --git a/components/autofill/core/browser/autofill_manager.h b/components/autofill/core/browser/autofill_manager.h
index 72454ed..fafbbda 100644
--- a/components/autofill/core/browser/autofill_manager.h
+++ b/components/autofill/core/browser/autofill_manager.h
@@ -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,