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

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

Issue 2496683003: Http Bad: Add a PopupItemId to identify http warning message (Closed)
Patch Set: update Created 4 years, 1 month 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_external_delegate.cc
diff --git a/components/autofill/core/browser/autofill_external_delegate.cc b/components/autofill/core/browser/autofill_external_delegate.cc
index 96a96c348790d6920f67b7bf25b5b8c18a43aeff..44264662a03bf37a9fe63bfc4918df5166910b90 100644
--- a/components/autofill/core/browser/autofill_external_delegate.cc
+++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -31,9 +31,11 @@ namespace autofill {
namespace {
// Returns true if the suggestion entry is an Autofill warning message.
-// Warning message should display on top of suggestion list.
+// Warning messages should display on top of suggestion list.
bool IsAutofillWarningEntry(int frontend_id) {
- return frontend_id == POPUP_ITEM_ID_WARNING_MESSAGE;
+ return frontend_id ==
+ POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE ||
+ frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE;
}
} // anonymous namespace
@@ -293,7 +295,7 @@ void AutofillExternalDelegate::OnCreditCardScanned(const CreditCard& card) {
void AutofillExternalDelegate::FillAutofillFormData(int unique_id,
bool is_preview) {
// If the selected element is a warning we don't want to do anything.
- if (unique_id == POPUP_ITEM_ID_WARNING_MESSAGE)
+ if (IsAutofillWarningEntry(unique_id))
return;
AutofillDriver::RendererFormDataAction renderer_action = is_preview ?

Powered by Google App Engine
This is Rietveld 408576698