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

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: 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 7257057a95ecc572a1462bdc9ca4b5014b5c14de..0a58fabd0b9db879a62a9280a882064f12dca6f4 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 = "http";
+ } 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),
+ "", icon_str,
vabr (Chromium) 2016/11/15 17:46:04 nit: Please use std::string() instead of "". The f
lshang 2016/11/16 10:33:08 Done.
+ autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE);
suggestions.insert(suggestions.begin(),
password_field_http_warning_suggestion);
}

Powered by Google App Engine
This is Rietveld 408576698