| 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();
|
| }
|
|
|
|
|