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

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

Issue 667043002: Add a flag to ignore autocomplete="off" for Autofill. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: fix preview on fields with no autocomplete="off" / add a flag to disable https:// requirements for … Created 6 years, 2 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 48cd5974c206b50c064630dace3cb85731b24497..9d44a81e8a3546d52b8ebad169cb37c6a9dcf85d 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -493,8 +493,11 @@ 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 (is_filling_credit_card && !FormIsHTTPS(*form_structure))
+ if (is_filling_credit_card && !FormIsHTTPS(*form_structure) &&
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ "reduce-security-for-testing")) {
Evan Stade 2014/10/22 21:52:33 this is a string literal because the flag is defin
Ilya Sherman 2014/10/23 00:35:27 This seems unrelated to this CL. I'd honestly pre
Evan Stade 2014/10/23 02:02:20 split this into a separate CL.
warning = IDS_AUTOFILL_WARNING_INSECURE_CONNECTION;
+ }
if (warning) {
values.assign(1, l10n_util::GetStringUTF16(warning));
labels.assign(1, base::string16());
@@ -530,12 +533,20 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
}
}
- // Add the results from AutoComplete. They come back asynchronously, so we
- // hand off what we generated and they will send the results back to the
- // renderer.
- autocomplete_history_manager_->OnGetAutocompleteSuggestions(
- query_id, field.name, field.value, field.form_control_type, values,
- labels, icons, unique_ids);
+ if (field.should_autocomplete) {
+ // Add the results from AutoComplete. They come back asynchronously, so we
+ // hand off what we generated and they will send the results back to the
+ // renderer.
+ autocomplete_history_manager_->OnGetAutocompleteSuggestions(
+ query_id, field.name, field.value, field.form_control_type, values,
+ labels, icons, unique_ids);
+ } else {
+ // Autocomplete is disabled for this field; only pass back Autofill
+ // suggestions.
+ autocomplete_history_manager_->CancelPendingQuery();
+ external_delegate_->OnSuggestionsReturned(
+ query_id, values, labels, icons, unique_ids);
+ }
}
void AutofillManager::FillOrPreviewForm(

Powered by Google App Engine
This is Rietveld 408576698