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

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

Issue 492043003: Fill on account select in the password manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on ToT Created 6 years, 2 months 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 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();
}

Powered by Google App Engine
This is Rietveld 408576698