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 ab03c02396b9bcf586ac314a375ef4501d1d9ee2..2a8b32ecab8e90f5fb70c6d21830272b2e908eb0 100644 |
--- a/components/password_manager/core/browser/password_autofill_manager.cc |
+++ b/components/password_manager/core/browser/password_autofill_manager.cc |
@@ -15,6 +15,8 @@ |
#include "components/autofill/core/common/autofill_data_validation.h" |
#include "components/password_manager/core/browser/password_manager_client.h" |
#include "components/password_manager/core/browser/password_manager_driver.h" |
+#include "components/strings/grit/components_strings.h" |
+#include "ui/base/l10n/l10n_util.h" |
namespace password_manager { |
@@ -107,9 +109,10 @@ void PasswordAutofillManager::OnAddPasswordFormMapping( |
login_to_password_info_[field] = fill_data; |
} |
-void PasswordAutofillManager::OnShowPasswordSuggestions( |
+void PasswordAutofillManager::ShowPasswordSuggestions( |
const autofill::FormFieldData& field, |
const base::string16& typed_username, |
+ const base::string16& title, |
bool show_all, |
const gfx::RectF& bounds) { |
std::vector<base::string16> suggestions; |
@@ -136,15 +139,30 @@ void PasswordAutofillManager::OnShowPasswordSuggestions( |
std::vector<base::string16> empty(suggestions.size()); |
std::vector<int> password_ids(suggestions.size(), |
autofill::POPUP_ITEM_ID_PASSWORD_ENTRY); |
- autofill_client_->ShowAutofillPopup(bounds, |
- field.text_direction, |
- suggestions, |
- realms, |
- empty, |
- password_ids, |
+ autofill_client_->ShowAutofillPopup(bounds, field.text_direction, suggestions, |
+ realms, empty, password_ids, title, |
weak_ptr_factory_.GetWeakPtr()); |
} |
+void PasswordAutofillManager::OnShowPasswordSuggestions( |
+ const autofill::FormFieldData& field, |
+ const base::string16& typed_username, |
+ bool show_all, |
+ const gfx::RectF& bounds) { |
+ ShowPasswordSuggestions(field, typed_username, base::string16(), show_all, |
+ bounds); |
+} |
+ |
+void PasswordAutofillManager::OnShowPasswordSuggestionsWithTitle( |
+ const autofill::FormFieldData& field, |
+ const base::string16& typed_username, |
+ bool show_all, |
+ const gfx::RectF& bounds) { |
+ const base::string16 title = |
+ l10n_util::GetStringUTF16(IDS_AUTOFILL_PASSWORD_FIELD_SUGGESTIONS_TITLE); |
+ ShowPasswordSuggestions(field, typed_username, title, show_all, bounds); |
+} |
+ |
void PasswordAutofillManager::Reset() { |
login_to_password_info_.clear(); |
} |