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 87524328ce40f5c083019089da8253ca602c218b..a05823439ba1e587517de13bd4df3450123cc1e8 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 { |
@@ -108,7 +110,7 @@ void PasswordAutofillManager::OnShowPasswordSuggestions( |
int key, |
base::i18n::TextDirection text_direction, |
const base::string16& typed_username, |
- bool show_all, |
+ int options, |
const gfx::RectF& bounds) { |
std::vector<base::string16> suggestions; |
std::vector<base::string16> realms; |
@@ -120,7 +122,7 @@ void PasswordAutofillManager::OnShowPasswordSuggestions( |
return; |
} |
GetSuggestions(fill_data_it->second, typed_username, &suggestions, &realms, |
- show_all); |
+ options & autofill::ShowPasswordSuggestionsOptions::SHOW_ALL); |
DCHECK_EQ(suggestions.size(), realms.size()); |
form_data_key_ = key; |
@@ -130,9 +132,20 @@ void PasswordAutofillManager::OnShowPasswordSuggestions( |
return; |
} |
+ base::string16 password_field_suggestions_title; |
+ if (options & autofill::ShowPasswordSuggestionsOptions::IS_PASSWORD_FIELD) { |
Garrett Casto
2014/12/05 19:30:54
You should merge these two new if statements.
jww
2014/12/05 20:23:10
Done.
|
+ password_field_suggestions_title = l10n_util::GetStringUTF16( |
+ IDS_AUTOFILL_PASSWORD_FIELD_SUGGESTIONS_TITLE); |
+ } |
std::vector<base::string16> empty(suggestions.size()); |
std::vector<int> password_ids(suggestions.size(), |
autofill::POPUP_ITEM_ID_PASSWORD_ENTRY); |
+ if (!password_field_suggestions_title.empty()) { |
+ suggestions.insert(suggestions.begin(), password_field_suggestions_title); |
+ realms.insert(realms.begin(), base::string16()); |
+ empty.insert(empty.begin(), base::string16()); |
+ password_ids.insert(password_ids.begin(), autofill::POPUP_ITEM_ID_TITLE); |
+ } |
autofill_client_->ShowAutofillPopup(bounds, |
text_direction, |
suggestions, |