| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 282 |
| 283 int AutofillManager::AccessAddressBookPromptCount() { | 283 int AutofillManager::AccessAddressBookPromptCount() { |
| 284 if (!personal_data_) | 284 if (!personal_data_) |
| 285 return 0; | 285 return 0; |
| 286 return personal_data_->AccessAddressBookPromptCount(); | 286 return personal_data_->AccessAddressBookPromptCount(); |
| 287 } | 287 } |
| 288 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 288 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 289 | 289 |
| 290 bool AutofillManager::ShouldShowScanCreditCard(const FormData& form, | 290 bool AutofillManager::ShouldShowScanCreditCard(const FormData& form, |
| 291 const FormFieldData& field) { | 291 const FormFieldData& field) { |
| 292 if (CommandLine::ForCurrentProcess()->HasSwitch( | 292 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 293 autofill::switches::kDisableCreditCardScan)) { | 293 autofill::switches::kDisableCreditCardScan)) { |
| 294 return false; | 294 return false; |
| 295 } | 295 } |
| 296 | 296 |
| 297 if (!client_->HasCreditCardScanFeature()) | 297 if (!client_->HasCreditCardScanFeature()) |
| 298 return false; | 298 return false; |
| 299 | 299 |
| 300 AutofillField* autofill_field = GetAutofillField(form, field); | 300 AutofillField* autofill_field = GetAutofillField(form, field); |
| 301 return autofill_field && | 301 return autofill_field && |
| 302 autofill_field->Type().GetStorableType() == CREDIT_CARD_NUMBER; | 302 autofill_field->Type().GetStorableType() == CREDIT_CARD_NUMBER; |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 return false; | 1247 return false; |
| 1248 | 1248 |
| 1249 // Disregard forms that we wouldn't ever autofill in the first place. | 1249 // Disregard forms that we wouldn't ever autofill in the first place. |
| 1250 if (!form.ShouldBeParsed()) | 1250 if (!form.ShouldBeParsed()) |
| 1251 return false; | 1251 return false; |
| 1252 | 1252 |
| 1253 return true; | 1253 return true; |
| 1254 } | 1254 } |
| 1255 | 1255 |
| 1256 } // namespace autofill | 1256 } // namespace autofill |
| OLD | NEW |