| 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 // determine possible field types for the |submitted_form|. This is | 409 // determine possible field types for the |submitted_form|. This is |
| 410 // potentially expensive -- on the order of 50ms even for a small set of | 410 // potentially expensive -- on the order of 50ms even for a small set of |
| 411 // |stored_data|. Hence, it should not run on the UI thread -- to avoid | 411 // |stored_data|. Hence, it should not run on the UI thread -- to avoid |
| 412 // locking up the UI -- nor on the IO thread -- to avoid blocking IPC calls. | 412 // locking up the UI -- nor on the IO thread -- to avoid blocking IPC calls. |
| 413 static void DeterminePossibleFieldTypesForUpload( | 413 static void DeterminePossibleFieldTypesForUpload( |
| 414 const std::vector<AutofillProfile>& profiles, | 414 const std::vector<AutofillProfile>& profiles, |
| 415 const std::vector<CreditCard>& credit_cards, | 415 const std::vector<CreditCard>& credit_cards, |
| 416 const std::string& app_locale, | 416 const std::string& app_locale, |
| 417 FormStructure* submitted_form); | 417 FormStructure* submitted_form); |
| 418 | 418 |
| 419 // Uses context about previous and next fields to select the appropriate type |
| 420 // for fields with ambiguous upload types. |
| 421 static void DisambiguateUploadTypes(FormStructure* form); |
| 422 |
| 423 // Disambiguates address field upload types. |
| 424 static void DisambiguateAddressUploadTypes(FormStructure* form, |
| 425 size_t current_index); |
| 426 |
| 427 // Disambiguates phone field upload types. |
| 428 static void DisambiguatePhoneUploadTypes(FormStructure* form, |
| 429 size_t current_index); |
| 430 |
| 431 // Disambiguates name field upload types. |
| 432 static void DisambiguateNameUploadTypes( |
| 433 FormStructure* form, |
| 434 size_t current_index, |
| 435 const ServerFieldTypeSet& upload_types); |
| 436 |
| 419 #ifdef ENABLE_FORM_DEBUG_DUMP | 437 #ifdef ENABLE_FORM_DEBUG_DUMP |
| 420 // Dumps the cached forms to a file on disk. | 438 // Dumps the cached forms to a file on disk. |
| 421 void DumpAutofillData(bool imported_cc) const; | 439 void DumpAutofillData(bool imported_cc) const; |
| 422 #endif | 440 #endif |
| 423 | 441 |
| 424 // Provides driver-level context to the shared code of the component. Must | 442 // Provides driver-level context to the shared code of the component. Must |
| 425 // outlive this object. | 443 // outlive this object. |
| 426 AutofillDriver* driver_; | 444 AutofillDriver* driver_; |
| 427 | 445 |
| 428 AutofillClient* const client_; | 446 AutofillClient* const client_; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 AutofillManagerTestDelegate* test_delegate_; | 528 AutofillManagerTestDelegate* test_delegate_; |
| 511 | 529 |
| 512 base::WeakPtrFactory<AutofillManager> weak_ptr_factory_; | 530 base::WeakPtrFactory<AutofillManager> weak_ptr_factory_; |
| 513 | 531 |
| 514 friend class AutofillManagerTest; | 532 friend class AutofillManagerTest; |
| 515 friend class FormStructureBrowserTest; | 533 friend class FormStructureBrowserTest; |
| 516 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 534 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
| 517 DeterminePossibleFieldTypesForUpload); | 535 DeterminePossibleFieldTypesForUpload); |
| 518 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 536 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
| 519 DeterminePossibleFieldTypesForUploadStressTest); | 537 DeterminePossibleFieldTypesForUploadStressTest); |
| 538 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, DisambiguateUploadTypes); |
| 520 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 539 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
| 521 DisabledAutofillDispatchesError); | 540 DisabledAutofillDispatchesError); |
| 522 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AddressFilledFormEvents); | 541 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AddressFilledFormEvents); |
| 523 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AddressSubmittedFormEvents); | 542 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AddressSubmittedFormEvents); |
| 524 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AddressWillSubmitFormEvents); | 543 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AddressWillSubmitFormEvents); |
| 525 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AddressSuggestionsCount); | 544 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AddressSuggestionsCount); |
| 526 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AutofillIsEnabledAtPageLoad); | 545 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AutofillIsEnabledAtPageLoad); |
| 527 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, CreditCardSelectedFormEvents); | 546 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, CreditCardSelectedFormEvents); |
| 528 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, CreditCardFilledFormEvents); | 547 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, CreditCardFilledFormEvents); |
| 529 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, CreditCardGetRealPanDuration); | 548 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, CreditCardGetRealPanDuration); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 583 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
| 565 DontSaveCvcInAutocompleteHistory); | 584 DontSaveCvcInAutocompleteHistory); |
| 566 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, DontOfferToSavePaymentsCard); | 585 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, DontOfferToSavePaymentsCard); |
| 567 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, FillInUpdatedExpirationDate); | 586 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, FillInUpdatedExpirationDate); |
| 568 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 587 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
| 569 }; | 588 }; |
| 570 | 589 |
| 571 } // namespace autofill | 590 } // namespace autofill |
| 572 | 591 |
| 573 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ | 592 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ |
| OLD | NEW |