| 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 <memory> | 10 #include <memory> |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 // Parses the forms using heuristic matching and querying the Autofill server. | 420 // Parses the forms using heuristic matching and querying the Autofill server. |
| 421 void ParseForms(const std::vector<FormData>& forms); | 421 void ParseForms(const std::vector<FormData>& forms); |
| 422 | 422 |
| 423 // Parses the form and adds it to |form_structures_|. | 423 // Parses the form and adds it to |form_structures_|. |
| 424 bool ParseForm(const FormData& form, FormStructure** parsed_form_structure); | 424 bool ParseForm(const FormData& form, FormStructure** parsed_form_structure); |
| 425 | 425 |
| 426 // Imports the form data, submitted by the user, into |personal_data_|. | 426 // Imports the form data, submitted by the user, into |personal_data_|. |
| 427 void ImportFormData(const FormStructure& submitted_form); | 427 void ImportFormData(const FormStructure& submitted_form); |
| 428 | 428 |
| 429 // Logs |metric_name| with RAPPOR, for the specific form |source_url|. | 429 // Logs |metric_name| with RAPPOR, for the specific form |source_url|. |
| 430 void CollectRapportSample(const GURL& source_url, | 430 void CollectRapporSample(const GURL& source_url, |
| 431 const std::string& metric_name) const; | 431 const std::string& metric_name) const; |
| 432 | 432 |
| 433 // Examines |card| and the stored profiles and if a candidate set of profiles | 433 // Examines |card| and the stored profiles and if a candidate set of profiles |
| 434 // is found that matches the client-side validation rules, assigns the values | 434 // is found that matches the client-side validation rules, assigns the values |
| 435 // to |profiles|. If no valid set can be found, returns false, assigns the | 435 // to |profiles|. If no valid set can be found, returns false, assigns the |
| 436 // failure reason to |address_upload_decision_metric|, and if applicable, the | 436 // failure reasons to |upload_decision_metrics| and, if applicable, the RAPPOR |
| 437 // RAPPOR metric to log to |rappor_metric_name|. | 437 // metric to log to |rappor_metric_name|. |
| 438 bool GetProfilesForCreditCardUpload(const CreditCard& card, | 438 bool GetProfilesForCreditCardUpload( |
| 439 std::vector<AutofillProfile>* profiles, | 439 const CreditCard& card, |
| 440 autofill::AutofillMetrics:: | 440 std::vector<AutofillProfile>* profiles, |
| 441 CardUploadDecisionMetric* | 441 std::vector<AutofillMetrics::CardUploadDecisionMetric>* |
| 442 address_upload_decision_metric, | 442 upload_decision_metrics, |
| 443 std::string* rappor_metric_name) const; | 443 std::string* rappor_metric_name) const; |
| 444 | 444 |
| 445 // If |initial_interaction_timestamp_| is unset or is set to a later time than | 445 // If |initial_interaction_timestamp_| is unset or is set to a later time than |
| 446 // |interaction_timestamp|, updates the cached timestamp. The latter check is | 446 // |interaction_timestamp|, updates the cached timestamp. The latter check is |
| 447 // needed because IPC messages can arrive out of order. | 447 // needed because IPC messages can arrive out of order. |
| 448 void UpdateInitialInteractionTimestamp( | 448 void UpdateInitialInteractionTimestamp( |
| 449 const base::TimeTicks& interaction_timestamp); | 449 const base::TimeTicks& interaction_timestamp); |
| 450 | 450 |
| 451 // Examines |form| and returns true if it is in a non-secure context or | 451 // Examines |form| and returns true if it is in a non-secure context or |
| 452 // its action attribute targets a HTTP url. | 452 // its action attribute targets a HTTP url. |
| 453 bool IsFormNonSecure(const FormData& form) const; | 453 bool IsFormNonSecure(const FormData& form) const; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 479 static void DisambiguateNameUploadTypes( | 479 static void DisambiguateNameUploadTypes( |
| 480 FormStructure* form, | 480 FormStructure* form, |
| 481 size_t current_index, | 481 size_t current_index, |
| 482 const ServerFieldTypeSet& upload_types); | 482 const ServerFieldTypeSet& upload_types); |
| 483 | 483 |
| 484 #ifdef ENABLE_FORM_DEBUG_DUMP | 484 #ifdef ENABLE_FORM_DEBUG_DUMP |
| 485 // Dumps the cached forms to a file on disk. | 485 // Dumps the cached forms to a file on disk. |
| 486 void DumpAutofillData(bool imported_cc) const; | 486 void DumpAutofillData(bool imported_cc) const; |
| 487 #endif | 487 #endif |
| 488 | 488 |
| 489 // Logs the card upload decision UKM. | 489 // Logs the card upload decisions UKM. |
| 490 void LogCardUploadDecisionUkm( | 490 void LogCardUploadDecisionsUkm( |
| 491 AutofillMetrics::CardUploadDecisionMetric upload_decision); | 491 const std::vector<AutofillMetrics::CardUploadDecisionMetric>& |
| 492 upload_decisions); |
| 492 | 493 |
| 493 // Provides driver-level context to the shared code of the component. Must | 494 // Provides driver-level context to the shared code of the component. Must |
| 494 // outlive this object. | 495 // outlive this object. |
| 495 AutofillDriver* driver_; | 496 AutofillDriver* driver_; |
| 496 | 497 |
| 497 AutofillClient* const client_; | 498 AutofillClient* const client_; |
| 498 | 499 |
| 499 // Handles Payments service requests. | 500 // Handles Payments service requests. |
| 500 std::unique_ptr<payments::PaymentsClient> payments_client_; | 501 std::unique_ptr<payments::PaymentsClient> payments_client_; |
| 501 | 502 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 636 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
| 636 OnLoadedServerPredictions_ResetManager); | 637 OnLoadedServerPredictions_ResetManager); |
| 637 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, DontOfferToSavePaymentsCard); | 638 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, DontOfferToSavePaymentsCard); |
| 638 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, FillInUpdatedExpirationDate); | 639 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, FillInUpdatedExpirationDate); |
| 639 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 640 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
| 640 }; | 641 }; |
| 641 | 642 |
| 642 } // namespace autofill | 643 } // namespace autofill |
| 643 | 644 |
| 644 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ | 645 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ |
| OLD | NEW |