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

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

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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 8
9 #include <limits> 9 #include <limits>
10 #include <map> 10 #include <map>
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // profile or credit card, identify any stored types that match the value. 137 // profile or credit card, identify any stored types that match the value.
138 for (size_t i = 0; i < submitted_form->field_count(); ++i) { 138 for (size_t i = 0; i < submitted_form->field_count(); ++i) {
139 AutofillField* field = submitted_form->field(i); 139 AutofillField* field = submitted_form->field(i);
140 ServerFieldTypeSet matching_types; 140 ServerFieldTypeSet matching_types;
141 141
142 // If it's a password field, set the type directly. 142 // If it's a password field, set the type directly.
143 if (field->form_control_type == "password") { 143 if (field->form_control_type == "password") {
144 matching_types.insert(autofill::PASSWORD); 144 matching_types.insert(autofill::PASSWORD);
145 } else { 145 } else {
146 base::string16 value; 146 base::string16 value;
147 TrimWhitespace(field->value, TRIM_ALL, &value); 147 base::TrimWhitespace(field->value, base::TRIM_ALL, &value);
148 for (std::vector<AutofillProfile>::const_iterator it = profiles.begin(); 148 for (std::vector<AutofillProfile>::const_iterator it = profiles.begin();
149 it != profiles.end(); ++it) { 149 it != profiles.end(); ++it) {
150 it->GetMatchingTypes(value, app_locale, &matching_types); 150 it->GetMatchingTypes(value, app_locale, &matching_types);
151 } 151 }
152 for (std::vector<CreditCard>::const_iterator it = credit_cards.begin(); 152 for (std::vector<CreditCard>::const_iterator it = credit_cards.begin();
153 it != credit_cards.end(); ++it) { 153 it != credit_cards.end(); ++it) {
154 it->GetMatchingTypes(value, app_locale, &matching_types); 154 it->GetMatchingTypes(value, app_locale, &matching_types);
155 } 155 }
156 } 156 }
157 157
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 return false; 1156 return false;
1157 1157
1158 // Disregard forms that we wouldn't ever autofill in the first place. 1158 // Disregard forms that we wouldn't ever autofill in the first place.
1159 if (!form.ShouldBeParsed(true)) 1159 if (!form.ShouldBeParsed(true))
1160 return false; 1160 return false;
1161 1161
1162 return true; 1162 return true;
1163 } 1163 }
1164 1164
1165 } // namespace autofill 1165 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/content/renderer/form_autofill_util.cc ('k') | components/autofill/core/browser/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698