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

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

Issue 2505533002: Http Bad: Add "Learn more" sublabel to warning message and make it clickable (Closed)
Patch Set: rebase Created 4 years 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 1d90a31dc9fb766e4e365664ad3e0441919afe3a..b0a14d5f5432ffa341069bf3812a91e74653c6eb 100644
--- a/components/password_manager/core/browser/password_autofill_manager.cc
+++ b/components/password_manager/core/browser/password_autofill_manager.cc
@@ -230,8 +230,8 @@ void PasswordAutofillManager::OnShowPasswordSuggestions(
autofill::Suggestion password_field_http_warning_suggestion(
l10n_util::GetStringUTF8(IDS_AUTOFILL_PASSWORD_HTTP_WARNING_MESSAGE),
- std::string(), icon_str,
- autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE);
+ l10n_util::GetStringUTF8(IDS_AUTOFILL_HTTP_WARNING_LEARN_MORE),
+ icon_str, autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE);
suggestions.insert(suggestions.begin(),
password_field_http_warning_suggestion);
}
@@ -267,6 +267,8 @@ void PasswordAutofillManager::OnPopupHidden() {
void PasswordAutofillManager::DidSelectSuggestion(const base::string16& value,
int identifier) {
ClearPreviewedForm();
+ if (identifier == autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE)
+ return;
bool success =
PreviewSuggestion(form_data_key_, GetUsernameFromSuggestion(value));
DCHECK(success);
@@ -275,9 +277,13 @@ void PasswordAutofillManager::DidSelectSuggestion(const base::string16& value,
void PasswordAutofillManager::DidAcceptSuggestion(const base::string16& value,
int identifier,
int position) {
- bool success =
- FillSuggestion(form_data_key_, GetUsernameFromSuggestion(value));
- DCHECK(success);
+ if (identifier == autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) {
+ autofill_client_->ShowHttpNotSecureExplanation();
+ } else {
+ bool success =
+ FillSuggestion(form_data_key_, GetUsernameFromSuggestion(value));
+ DCHECK(success);
+ }
autofill_client_->HideAutofillPopup();
}
« no previous file with comments | « components/autofill_strings.grdp ('k') | components/password_manager/core/browser/password_autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698