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

Unified Diff: ios/chrome/browser/passwords/password_controller.mm

Issue 2262843002: Make PasswordFormManager::best_matches_ const (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@621355_pass_creds_to_update_by_value
Patch Set: Just rebased Created 4 years, 4 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: ios/chrome/browser/passwords/password_controller.mm
diff --git a/ios/chrome/browser/passwords/password_controller.mm b/ios/chrome/browser/passwords/password_controller.mm
index e3f4bf16e90dfb482cd2dcb7930f920cd4366864..793f97144f47f5546c93d88049b34c472248c3c0 100644
--- a/ios/chrome/browser/passwords/password_controller.mm
+++ b/ios/chrome/browser/passwords/password_controller.mm
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <algorithm>
+#include <map>
#include <memory>
#include <utility>
#include <vector>
@@ -345,13 +346,11 @@ bool GetPageURLAndCheckTrustLevel(web::WebState* web_state, GURL* page_url) {
const std::vector<autofill::PasswordForm>& forms) {
for (const auto& form : forms) {
autofill::PasswordFormFillData formData;
- autofill::PasswordFormMap matches;
+ std::map<base::string16, const autofill::PasswordForm*> matches;
// Initialize |matches| to satisfy the expectation from
// InitPasswordFormFillData() that the preferred match (3rd parameter)
// should be one of the |matches|.
- auto scoped_form = base::WrapUnique(new autofill::PasswordForm(form));
- matches.insert(
- std::make_pair(form.username_value, std::move(scoped_form)));
+ matches.insert(std::make_pair(form.username_value, &form));
autofill::InitPasswordFormFillData(form, matches, &form, false, false,
&formData);
[self fillPasswordForm:formData

Powered by Google App Engine
This is Rietveld 408576698