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 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 } | 1101 } |
1102 | 1102 |
1103 // Even though we always update the cache, the field might not exist if the | 1103 // Even though we always update the cache, the field might not exist if the |
1104 // website disables autocomplete while the user is interacting with the form. | 1104 // website disables autocomplete while the user is interacting with the form. |
1105 // See http://crbug.com/160476 | 1105 // See http://crbug.com/160476 |
1106 return *autofill_field != NULL; | 1106 return *autofill_field != NULL; |
1107 } | 1107 } |
1108 | 1108 |
1109 AutofillField* AutofillManager::GetAutofillField(const FormData& form, | 1109 AutofillField* AutofillManager::GetAutofillField(const FormData& form, |
1110 const FormFieldData& field) { | 1110 const FormFieldData& field) { |
1111 if (!personal_data_ || !field.should_autocomplete) | 1111 if (!personal_data_) |
1112 return NULL; | 1112 return NULL; |
1113 | 1113 |
1114 FormStructure* form_structure = NULL; | 1114 FormStructure* form_structure = NULL; |
1115 AutofillField* autofill_field = NULL; | 1115 AutofillField* autofill_field = NULL; |
1116 if (!GetCachedFormAndField(form, field, &form_structure, &autofill_field)) | 1116 if (!GetCachedFormAndField(form, field, &form_structure, &autofill_field)) |
1117 return NULL; | 1117 return NULL; |
1118 | 1118 |
1119 if (!form_structure->IsAutofillable()) | 1119 if (!form_structure->IsAutofillable()) |
1120 return NULL; | 1120 return NULL; |
1121 | 1121 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 return false; | 1325 return false; |
1326 | 1326 |
1327 // Disregard forms that we wouldn't ever autofill in the first place. | 1327 // Disregard forms that we wouldn't ever autofill in the first place. |
1328 if (!form.ShouldBeParsed()) | 1328 if (!form.ShouldBeParsed()) |
1329 return false; | 1329 return false; |
1330 | 1330 |
1331 return true; | 1331 return true; |
1332 } | 1332 } |
1333 | 1333 |
1334 } // namespace autofill | 1334 } // namespace autofill |
OLD | NEW |