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

Unified Diff: components/password_manager/core/browser/password_autofill_manager.cc

Issue 2498503002: Http Bad: Add icons to the http warning message (Closed)
Patch Set: rebase 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/password_manager/core/browser/password_autofill_manager.cc
diff --git a/components/password_manager/core/browser/password_autofill_manager.cc b/components/password_manager/core/browser/password_autofill_manager.cc
index 638c5ea74a4ad25a764c027b535ec0112b6379ef..1d90a31dc9fb766e4e365664ad3e0441919afe3a 100644
--- a/components/password_manager/core/browser/password_autofill_manager.cc
+++ b/components/password_manager/core/browser/password_autofill_manager.cc
@@ -218,11 +218,20 @@ void PasswordAutofillManager::OnShowPasswordSuggestions(
if (!is_context_secure &&
choice == security_state::switches::
kMarkHttpWithPasswordsOrCcWithChipAndFormWarning) {
+ std::string icon_str;
+
+ // Show http info icon for http sites.
+ if (origin.is_valid() && origin.SchemeIs("http")) {
+ icon_str = "httpWarning";
+ } else {
+ // Show https_invalid icon for broken https sites.
+ icon_str = "httpsInvalid";
+ }
+
autofill::Suggestion password_field_http_warning_suggestion(
- l10n_util::GetStringUTF16(
- IDS_AUTOFILL_PASSWORD_HTTP_WARNING_MESSAGE));
- password_field_http_warning_suggestion.frontend_id =
- autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE;
+ l10n_util::GetStringUTF8(IDS_AUTOFILL_PASSWORD_HTTP_WARNING_MESSAGE),
+ std::string(), icon_str,
+ autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE);
suggestions.insert(suggestions.begin(),
password_field_http_warning_suggestion);
}
« no previous file with comments | « components/autofill/core/browser/autofill_manager_unittest.cc ('k') | components/resources/autofill_scaled_resources.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698