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

Side by Side Diff: components/autofill/core/browser/autofill_manager.cc

Issue 2796873002: Sending autofill types for username fields in sign-in forms for improving username detection. (Closed)
Patch Set: Fix compilation error Created 3 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/autofill/core/browser/autofill_manager.h" 5 #include "components/autofill/core/browser/autofill_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after
2000 // static 2000 // static
2001 void AutofillManager::DeterminePossibleFieldTypesForUpload( 2001 void AutofillManager::DeterminePossibleFieldTypesForUpload(
2002 const std::vector<AutofillProfile>& profiles, 2002 const std::vector<AutofillProfile>& profiles,
2003 const std::vector<CreditCard>& credit_cards, 2003 const std::vector<CreditCard>& credit_cards,
2004 const std::string& app_locale, 2004 const std::string& app_locale,
2005 FormStructure* submitted_form) { 2005 FormStructure* submitted_form) {
2006 // For each field in the |submitted_form|, extract the value. Then for each 2006 // For each field in the |submitted_form|, extract the value. Then for each
2007 // profile or credit card, identify any stored types that match the value. 2007 // profile or credit card, identify any stored types that match the value.
2008 for (size_t i = 0; i < submitted_form->field_count(); ++i) { 2008 for (size_t i = 0; i < submitted_form->field_count(); ++i) {
2009 AutofillField* field = submitted_form->field(i); 2009 AutofillField* field = submitted_form->field(i);
2010 ServerFieldTypeSet matching_types; 2010 ServerFieldTypeSet matching_types = field->possible_types();
2011 2011
2012 base::string16 value; 2012 base::string16 value;
2013 base::TrimWhitespace(field->value, base::TRIM_ALL, &value); 2013 base::TrimWhitespace(field->value, base::TRIM_ALL, &value);
2014 2014
2015 for (const AutofillProfile& profile : profiles) 2015 for (const AutofillProfile& profile : profiles)
2016 profile.GetMatchingTypes(value, app_locale, &matching_types); 2016 profile.GetMatchingTypes(value, app_locale, &matching_types);
2017 for (const CreditCard& card : credit_cards) 2017 for (const CreditCard& card : credit_cards)
2018 card.GetMatchingTypes(value, app_locale, &matching_types); 2018 card.GetMatchingTypes(value, app_locale, &matching_types);
2019 2019
2020 if (matching_types.empty()) 2020 if (matching_types.empty())
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
2198 } 2198 }
2199 #endif // ENABLE_FORM_DEBUG_DUMP 2199 #endif // ENABLE_FORM_DEBUG_DUMP
2200 2200
2201 void AutofillManager::LogCardUploadDecisionUkm( 2201 void AutofillManager::LogCardUploadDecisionUkm(
2202 AutofillMetrics::CardUploadDecisionMetric upload_decision) { 2202 AutofillMetrics::CardUploadDecisionMetric upload_decision) {
2203 AutofillMetrics::LogCardUploadDecisionUkm( 2203 AutofillMetrics::LogCardUploadDecisionUkm(
2204 client_->GetUkmService(), pending_upload_request_url_, upload_decision); 2204 client_->GetUkmService(), pending_upload_request_url_, upload_decision);
2205 } 2205 }
2206 2206
2207 } // namespace autofill 2207 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_manager.h ('k') | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698