| 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 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "components/autofill/core/browser/credit_card.h" | 43 #include "components/autofill/core/browser/credit_card.h" |
| 44 #include "components/autofill/core/browser/field_types.h" | 44 #include "components/autofill/core/browser/field_types.h" |
| 45 #include "components/autofill/core/browser/form_structure.h" | 45 #include "components/autofill/core/browser/form_structure.h" |
| 46 #include "components/autofill/core/browser/personal_data_manager.h" | 46 #include "components/autofill/core/browser/personal_data_manager.h" |
| 47 #include "components/autofill/core/browser/phone_number.h" | 47 #include "components/autofill/core/browser/phone_number.h" |
| 48 #include "components/autofill/core/browser/phone_number_i18n.h" | 48 #include "components/autofill/core/browser/phone_number_i18n.h" |
| 49 #include "components/autofill/core/browser/popup_item_ids.h" | 49 #include "components/autofill/core/browser/popup_item_ids.h" |
| 50 #include "components/autofill/core/common/autofill_constants.h" | 50 #include "components/autofill/core/common/autofill_constants.h" |
| 51 #include "components/autofill/core/common/autofill_data_validation.h" | 51 #include "components/autofill/core/common/autofill_data_validation.h" |
| 52 #include "components/autofill/core/common/autofill_pref_names.h" | 52 #include "components/autofill/core/common/autofill_pref_names.h" |
| 53 #include "components/autofill/core/common/autofill_switches.h" | |
| 54 #include "components/autofill/core/common/autofill_util.h" | 53 #include "components/autofill/core/common/autofill_util.h" |
| 55 #include "components/autofill/core/common/form_data.h" | 54 #include "components/autofill/core/common/form_data.h" |
| 56 #include "components/autofill/core/common/form_data_predictions.h" | 55 #include "components/autofill/core/common/form_data_predictions.h" |
| 57 #include "components/autofill/core/common/form_field_data.h" | 56 #include "components/autofill/core/common/form_field_data.h" |
| 58 #include "components/autofill/core/common/password_form_fill_data.h" | 57 #include "components/autofill/core/common/password_form_fill_data.h" |
| 59 #include "components/pref_registry/pref_registry_syncable.h" | 58 #include "components/pref_registry/pref_registry_syncable.h" |
| 60 #include "components/prefs/pref_service.h" | 59 #include "components/prefs/pref_service.h" |
| 61 #include "components/rappor/rappor_utils.h" | 60 #include "components/rappor/rappor_utils.h" |
| 62 #include "google_apis/gaia/identity_provider.h" | 61 #include "google_apis/gaia/identity_provider.h" |
| 63 #include "grit/components_strings.h" | 62 #include "grit/components_strings.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 external_delegate_ = delegate; | 249 external_delegate_ = delegate; |
| 251 autocomplete_history_manager_->SetExternalDelegate(delegate); | 250 autocomplete_history_manager_->SetExternalDelegate(delegate); |
| 252 } | 251 } |
| 253 | 252 |
| 254 void AutofillManager::ShowAutofillSettings() { | 253 void AutofillManager::ShowAutofillSettings() { |
| 255 client_->ShowAutofillSettings(); | 254 client_->ShowAutofillSettings(); |
| 256 } | 255 } |
| 257 | 256 |
| 258 bool AutofillManager::ShouldShowScanCreditCard(const FormData& form, | 257 bool AutofillManager::ShouldShowScanCreditCard(const FormData& form, |
| 259 const FormFieldData& field) { | 258 const FormFieldData& field) { |
| 260 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 261 switches::kDisableCreditCardScan)) { | |
| 262 return false; | |
| 263 } | |
| 264 | |
| 265 if (!client_->HasCreditCardScanFeature()) | 259 if (!client_->HasCreditCardScanFeature()) |
| 266 return false; | 260 return false; |
| 267 | 261 |
| 268 AutofillField* autofill_field = GetAutofillField(form, field); | 262 AutofillField* autofill_field = GetAutofillField(form, field); |
| 269 if (!autofill_field || | 263 if (!autofill_field || |
| 270 autofill_field->Type().GetStorableType() != CREDIT_CARD_NUMBER) { | 264 autofill_field->Type().GetStorableType() != CREDIT_CARD_NUMBER) { |
| 271 return false; | 265 return false; |
| 272 } | 266 } |
| 273 | 267 |
| 274 static const int kShowScanCreditCardMaxValueLength = 6; | 268 static const int kShowScanCreditCardMaxValueLength = 6; |
| (...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2047 if (i > 0) | 2041 if (i > 0) |
| 2048 fputs("Next oldest form:\n", file); | 2042 fputs("Next oldest form:\n", file); |
| 2049 } | 2043 } |
| 2050 fputs("\n", file); | 2044 fputs("\n", file); |
| 2051 | 2045 |
| 2052 fclose(file); | 2046 fclose(file); |
| 2053 } | 2047 } |
| 2054 #endif // ENABLE_FORM_DEBUG_DUMP | 2048 #endif // ENABLE_FORM_DEBUG_DUMP |
| 2055 | 2049 |
| 2056 } // namespace autofill | 2050 } // namespace autofill |
| OLD | NEW |