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

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

Issue 2498503002: Http Bad: Add icons to the http warning message (Closed)
Patch Set: 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_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index d7e7cfcf3e2bb6bb3f98cf20f8441a302e74f6fc..64d0f26a89587fd20c1fa40bbe3e77183d95748f 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -576,10 +576,21 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
// On top of the explanation message, first show a "Payment not secure"
// message.
if (IsCreditCardAutofillHttpWarningEnabled()) {
- Suggestion cc_field_http_warning_suggestion(l10n_util::GetStringUTF16(
- IDS_AUTOFILL_CREDIT_CARD_HTTP_WARNING_MESSAGE));
- cc_field_http_warning_suggestion.frontend_id =
- POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE;
+ std::string icon_str;
Mathieu 2016/11/16 04:53:09 I think there is enough here to create an anonymou
lshang 2016/11/16 10:33:08 Done.
+
+ // Show http info icon for http sites.
+ if (form_structure->source_url().is_valid() &&
+ form_structure->source_url().SchemeIs("http")) {
+ icon_str = "http";
+ } else {
+ // Show https_invalid icon for broken https sites.
+ icon_str = "httpsInvalid";
+ }
+
+ Suggestion cc_field_http_warning_suggestion(
+ l10n_util::GetStringUTF8(
+ IDS_AUTOFILL_CREDIT_CARD_HTTP_WARNING_MESSAGE),
+ "", icon_str, POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE);
suggestions.insert(suggestions.begin(),
cc_field_http_warning_suggestion);
}

Powered by Google App Engine
This is Rietveld 408576698