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

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: 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..d936d00929aff71d0d53988bb5e52b067b87b100 100644
--- a/components/password_manager/core/browser/password_autofill_manager.cc
+++ b/components/password_manager/core/browser/password_autofill_manager.cc
@@ -35,6 +35,9 @@ namespace password_manager {
namespace {
+const char kSecurityIndicatorHelpCenterURL[] =
+ "https://support.google.com/chrome/answer/95617?hl=en";
+
// Returns |username| unless it is empty. For an empty |username| returns a
// localised string saying this username is empty. Use this for displaying the
// usernames to the user.
@@ -219,10 +222,9 @@ void PasswordAutofillManager::OnShowPasswordSuggestions(
choice == security_state::switches::
kMarkHttpWithPasswordsOrCcWithChipAndFormWarning) {
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),
+ l10n_util::GetStringUTF8(IDS_AUTOFILL_HTTP_WARNING_LEARN_MORE), "",
+ autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE);
suggestions.insert(suggestions.begin(),
password_field_http_warning_suggestion);
}
@@ -258,6 +260,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);
@@ -266,9 +270,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_->OpenUrl(GURL(kSecurityIndicatorHelpCenterURL));
+ } else {
+ bool success =
+ FillSuggestion(form_data_key_, GetUsernameFromSuggestion(value));
+ DCHECK(success);
+ }
autofill_client_->HideAutofillPopup();
}

Powered by Google App Engine
This is Rietveld 408576698