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_PERSONAL_DATA_MANAGER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 const std::vector<ServerFieldType>& other_field_types); | 225 const std::vector<ServerFieldType>& other_field_types); |
226 | 226 |
227 // Returns the credit cards to suggest to the user. Those have been deduped | 227 // Returns the credit cards to suggest to the user. Those have been deduped |
228 // and ordered by frecency with the expired cards put at the end of the | 228 // and ordered by frecency with the expired cards put at the end of the |
229 // vector. | 229 // vector. |
230 const std::vector<CreditCard*> GetCreditCardsToSuggest() const; | 230 const std::vector<CreditCard*> GetCreditCardsToSuggest() const; |
231 | 231 |
232 // Gets credit cards that can suggest data for |type|. See | 232 // Gets credit cards that can suggest data for |type|. See |
233 // GetProfileSuggestions for argument descriptions. The variant in each | 233 // GetProfileSuggestions for argument descriptions. The variant in each |
234 // GUID pair should be ignored. | 234 // GUID pair should be ignored. |
235 // Also sets isBankNameAvailable to true if bank names are available for at | |
236 // least one suggestion. | |
235 std::vector<Suggestion> GetCreditCardSuggestions( | 237 std::vector<Suggestion> GetCreditCardSuggestions( |
236 const AutofillType& type, | 238 const AutofillType& type, |
237 const base::string16& field_contents); | 239 const base::string16& field_contents, |
240 bool& isBankNameAvailable); | |
sebsg
2017/06/12 21:17:00
This is contrary to the Google C++ style guide, al
Shanfeng
2017/06/12 23:34:58
Done.
| |
238 | 241 |
239 // Re-loads profiles and credit cards from the WebDatabase asynchronously. | 242 // Re-loads profiles and credit cards from the WebDatabase asynchronously. |
240 // In the general case, this is a no-op and will re-create the same | 243 // In the general case, this is a no-op and will re-create the same |
241 // in-memory model as existed prior to the call. If any change occurred to | 244 // in-memory model as existed prior to the call. If any change occurred to |
242 // profiles in the WebDatabase directly, as is the case if the browser sync | 245 // profiles in the WebDatabase directly, as is the case if the browser sync |
243 // engine processed a change from the cloud, we will learn of these as a | 246 // engine processed a change from the cloud, we will learn of these as a |
244 // result of this call. | 247 // result of this call. |
245 // | 248 // |
246 // Also see SetProfile for more details. | 249 // Also see SetProfile for more details. |
247 virtual void Refresh(); | 250 virtual void Refresh(); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
496 bool* imported_credit_card_matches_masked_server_credit_card); | 499 bool* imported_credit_card_matches_masked_server_credit_card); |
497 | 500 |
498 // Functionally equivalent to GetProfiles(), but also records metrics if | 501 // Functionally equivalent to GetProfiles(), but also records metrics if |
499 // |record_metrics| is true. Metrics should be recorded when the returned | 502 // |record_metrics| is true. Metrics should be recorded when the returned |
500 // profiles will be used to populate the fields shown in an Autofill popup. | 503 // profiles will be used to populate the fields shown in an Autofill popup. |
501 virtual const std::vector<AutofillProfile*>& GetProfiles( | 504 virtual const std::vector<AutofillProfile*>& GetProfiles( |
502 bool record_metrics) const; | 505 bool record_metrics) const; |
503 | 506 |
504 // Returns credit card suggestions based on the |cards_to_suggest| and the | 507 // Returns credit card suggestions based on the |cards_to_suggest| and the |
505 // |type| and |field_contents| of the credit card field. | 508 // |type| and |field_contents| of the credit card field. |
509 // Also sets isBankNameAvailable to true if bank names are available for at | |
510 // least one suggestion. | |
506 std::vector<Suggestion> GetSuggestionsForCards( | 511 std::vector<Suggestion> GetSuggestionsForCards( |
507 const AutofillType& type, | 512 const AutofillType& type, |
508 const base::string16& field_contents, | 513 const base::string16& field_contents, |
509 const std::vector<CreditCard*>& cards_to_suggest) const; | 514 const std::vector<CreditCard*>& cards_to_suggest, |
515 bool& isBankNameAvailable) const; | |
sebsg
2017/06/12 21:17:00
ditto
Shanfeng
2017/06/12 23:34:58
Done.
| |
510 | 516 |
511 // Runs the Autofill use date fix routine if it's never been done. Returns | 517 // Runs the Autofill use date fix routine if it's never been done. Returns |
512 // whether the routine was run. | 518 // whether the routine was run. |
513 void ApplyProfileUseDatesFix(); | 519 void ApplyProfileUseDatesFix(); |
514 | 520 |
515 // Applies the deduping routine once per major version if the feature is | 521 // Applies the deduping routine once per major version if the feature is |
516 // enabled. Calls DedupeProfiles with the content of |web_profiles_| as a | 522 // enabled. Calls DedupeProfiles with the content of |web_profiles_| as a |
517 // parameter. Removes the profiles to delete from the database and updates the | 523 // parameter. Removes the profiles to delete from the database and updates the |
518 // others. Also updates the credit cards' billing address references. Returns | 524 // others. Also updates the credit cards' billing address references. Returns |
519 // true if the routine was run. | 525 // true if the routine was run. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
618 // The context for the request to be used to fetch libaddressinput's address | 624 // The context for the request to be used to fetch libaddressinput's address |
619 // validation rules. | 625 // validation rules. |
620 scoped_refptr<net::URLRequestContextGetter> context_getter_; | 626 scoped_refptr<net::URLRequestContextGetter> context_getter_; |
621 | 627 |
622 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); | 628 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); |
623 }; | 629 }; |
624 | 630 |
625 } // namespace autofill | 631 } // namespace autofill |
626 | 632 |
627 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ | 633 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ |
OLD | NEW |