OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/password_manager/core/browser/password_form_manager.h" | 5 #include "components/password_manager/core/browser/password_form_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 } | 1281 } |
1282 | 1282 |
1283 // If this was a password update, then update all non-best matches entries | 1283 // If this was a password update, then update all non-best matches entries |
1284 // with the same username and the same old password. | 1284 // with the same username and the same old password. |
1285 if (update_related_credentials) { | 1285 if (update_related_credentials) { |
1286 auto updated_password_it = | 1286 auto updated_password_it = |
1287 best_matches_.find(pending_credentials_.username_value); | 1287 best_matches_.find(pending_credentials_.username_value); |
1288 DCHECK(best_matches_.end() != updated_password_it); | 1288 DCHECK(best_matches_.end() != updated_password_it); |
1289 const base::string16& old_password = | 1289 const base::string16& old_password = |
1290 updated_password_it->second->password_value; | 1290 updated_password_it->second->password_value; |
1291 for (const auto& not_best_match : not_best_matches_) { | 1291 for (auto* not_best_match : not_best_matches_) { |
1292 if (not_best_match->username_value == | 1292 if (not_best_match->username_value == |
1293 pending_credentials_.username_value && | 1293 pending_credentials_.username_value && |
1294 not_best_match->password_value == old_password) { | 1294 not_best_match->password_value == old_password) { |
1295 credentials_to_update->push_back(*not_best_match); | 1295 credentials_to_update->push_back(*not_best_match); |
1296 credentials_to_update->back().password_value = | 1296 credentials_to_update->back().password_value = |
1297 pending_credentials_.password_value; | 1297 pending_credentials_.password_value; |
1298 } | 1298 } |
1299 } | 1299 } |
1300 } | 1300 } |
1301 | 1301 |
1302 return old_primary_key; | 1302 return old_primary_key; |
1303 } | 1303 } |
1304 | 1304 |
1305 } // namespace password_manager | 1305 } // namespace password_manager |
OLD | NEW |