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

Side by Side Diff: components/password_manager/core/browser/password_form_manager.cc

Issue 2754273003: Introduce restricted PasswordFormManager::GrabFetcher (Closed)
Patch Set: Remove redundant CredentialManagerPasswordFormManager::form_fetcher_ Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 } 1221 }
1222 1222
1223 void PasswordFormManager::ResetStoredMatches() { 1223 void PasswordFormManager::ResetStoredMatches() {
1224 preferred_match_ = nullptr; 1224 preferred_match_ = nullptr;
1225 best_matches_.clear(); 1225 best_matches_.clear();
1226 not_best_matches_.clear(); 1226 not_best_matches_.clear();
1227 blacklisted_matches_.clear(); 1227 blacklisted_matches_.clear();
1228 new_blacklisted_.reset(); 1228 new_blacklisted_.reset();
1229 } 1229 }
1230 1230
1231 void PasswordFormManager::GrabFetcher(std::unique_ptr<FormFetcher> fetcher) {
1232 DCHECK(!owned_form_fetcher_);
1233 owned_form_fetcher_ = std::move(fetcher);
1234 DCHECK_EQ(owned_form_fetcher_.get(), form_fetcher_);
1235 }
1236
1231 void PasswordFormManager::SendVotesOnSave() { 1237 void PasswordFormManager::SendVotesOnSave() {
1232 if (observed_form_.IsPossibleChangePasswordFormWithoutUsername()) 1238 if (observed_form_.IsPossibleChangePasswordFormWithoutUsername())
1233 return; 1239 return;
1234 1240
1235 // Upload credentials the first time they are saved. This data is used 1241 // Upload credentials the first time they are saved. This data is used
1236 // by password generation to help determine account creation sites. 1242 // by password generation to help determine account creation sites.
1237 // Credentials that have been previously used (e.g., PSL matches) are checked 1243 // Credentials that have been previously used (e.g., PSL matches) are checked
1238 // to see if they are valid account creation forms. 1244 // to see if they are valid account creation forms.
1239 if (pending_credentials_.times_used == 0) { 1245 if (pending_credentials_.times_used == 0) {
1240 autofill::ServerFieldType password_type = autofill::PASSWORD; 1246 autofill::ServerFieldType password_type = autofill::PASSWORD;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 credentials_to_update->back().password_value = 1322 credentials_to_update->back().password_value =
1317 pending_credentials_.password_value; 1323 pending_credentials_.password_value;
1318 } 1324 }
1319 } 1325 }
1320 } 1326 }
1321 1327
1322 return old_primary_key; 1328 return old_primary_key;
1323 } 1329 }
1324 1330
1325 } // namespace password_manager 1331 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698