| OLD | NEW |
| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 if (matching_types.empty()) | 162 if (matching_types.empty()) |
| 163 matching_types.insert(UNKNOWN_TYPE); | 163 matching_types.insert(UNKNOWN_TYPE); |
| 164 | 164 |
| 165 field->set_possible_types(matching_types); | 165 field->set_possible_types(matching_types); |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 // Returns true if server returned known field types to one or more fields in | |
| 170 // this form. | |
| 171 bool HasServerSpecifiedFieldTypes(const FormStructure& form_structure) { | |
| 172 for (size_t i = 0; i < form_structure.field_count(); ++i) { | |
| 173 if (form_structure.field(i)->server_type() != NO_SERVER_DATA) | |
| 174 return true; | |
| 175 } | |
| 176 return false; | |
| 177 } | |
| 178 | |
| 179 } // namespace | 169 } // namespace |
| 180 | 170 |
| 181 AutofillManager::AutofillManager( | 171 AutofillManager::AutofillManager( |
| 182 AutofillDriver* driver, | 172 AutofillDriver* driver, |
| 183 autofill::AutofillManagerDelegate* delegate, | 173 autofill::AutofillManagerDelegate* delegate, |
| 184 const std::string& app_locale, | 174 const std::string& app_locale, |
| 185 AutofillDownloadManagerState enable_download_manager) | 175 AutofillDownloadManagerState enable_download_manager) |
| 186 : driver_(driver), | 176 : driver_(driver), |
| 187 manager_delegate_(delegate), | 177 manager_delegate_(delegate), |
| 188 app_locale_(app_locale), | 178 app_locale_(app_locale), |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 return false; | 1164 return false; |
| 1175 | 1165 |
| 1176 // Disregard forms that we wouldn't ever autofill in the first place. | 1166 // Disregard forms that we wouldn't ever autofill in the first place. |
| 1177 if (!form.ShouldBeParsed(true)) | 1167 if (!form.ShouldBeParsed(true)) |
| 1178 return false; | 1168 return false; |
| 1179 | 1169 |
| 1180 return true; | 1170 return true; |
| 1181 } | 1171 } |
| 1182 | 1172 |
| 1183 } // namespace autofill | 1173 } // namespace autofill |
| OLD | NEW |