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 <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 18 matching lines...) Expand all Loading... |
29 class Browser; | 29 class Browser; |
30 class PrefService; | 30 class PrefService; |
31 class RemoveAutofillTester; | 31 class RemoveAutofillTester; |
32 class SigninManagerBase; | 32 class SigninManagerBase; |
33 | 33 |
34 #if defined(OS_IOS) | 34 #if defined(OS_IOS) |
35 // TODO(crbug.com/513344): Remove this once Chrome on iOS is unforked. | 35 // TODO(crbug.com/513344): Remove this once Chrome on iOS is unforked. |
36 class PersonalDataManagerFactory; | 36 class PersonalDataManagerFactory; |
37 #endif | 37 #endif |
38 | 38 |
| 39 namespace sync_driver { |
| 40 class SyncService; |
| 41 } |
| 42 |
39 namespace autofill { | 43 namespace autofill { |
40 class AutofillInteractiveTest; | 44 class AutofillInteractiveTest; |
41 class AutofillTest; | 45 class AutofillTest; |
42 class FormStructure; | 46 class FormStructure; |
43 class PersonalDataManagerObserver; | 47 class PersonalDataManagerObserver; |
44 class PersonalDataManagerFactory; | 48 class PersonalDataManagerFactory; |
45 } // namespace autofill | 49 } // namespace autofill |
46 | 50 |
47 namespace autofill_helper { | 51 namespace autofill_helper { |
48 void SetProfiles(int, std::vector<autofill::AutofillProfile>*); | 52 void SetProfiles(int, std::vector<autofill::AutofillProfile>*); |
(...skipping 19 matching lines...) Expand all Loading... |
68 // Kicks off asynchronous loading of profiles and credit cards. | 72 // Kicks off asynchronous loading of profiles and credit cards. |
69 // |pref_service| must outlive this instance. |is_off_the_record| informs | 73 // |pref_service| must outlive this instance. |is_off_the_record| informs |
70 // this instance whether the user is currently operating in an off-the-record | 74 // this instance whether the user is currently operating in an off-the-record |
71 // context. | 75 // context. |
72 void Init(scoped_refptr<AutofillWebDataService> database, | 76 void Init(scoped_refptr<AutofillWebDataService> database, |
73 PrefService* pref_service, | 77 PrefService* pref_service, |
74 AccountTrackerService* account_tracker, | 78 AccountTrackerService* account_tracker, |
75 SigninManagerBase* signin_manager, | 79 SigninManagerBase* signin_manager, |
76 bool is_off_the_record); | 80 bool is_off_the_record); |
77 | 81 |
| 82 // Called once the sync service is known to be instantiated. Note that it may |
| 83 // not be started, but it's preferences can be queried. |
| 84 void OnSyncServiceInitialized(sync_driver::SyncService* sync_service); |
| 85 |
78 // WebDataServiceConsumer: | 86 // WebDataServiceConsumer: |
79 void OnWebDataServiceRequestDone(WebDataServiceBase::Handle h, | 87 void OnWebDataServiceRequestDone(WebDataServiceBase::Handle h, |
80 const WDTypedResult* result) override; | 88 const WDTypedResult* result) override; |
81 | 89 |
82 // AutofillWebDataServiceObserverOnUIThread: | 90 // AutofillWebDataServiceObserverOnUIThread: |
83 void AutofillMultipleChanged() override; | 91 void AutofillMultipleChanged() override; |
| 92 void SyncStarted(syncer::ModelType model_type) override; |
84 | 93 |
85 // Adds a listener to be notified of PersonalDataManager events. | 94 // Adds a listener to be notified of PersonalDataManager events. |
86 virtual void AddObserver(PersonalDataManagerObserver* observer); | 95 virtual void AddObserver(PersonalDataManagerObserver* observer); |
87 | 96 |
88 // Removes |observer| as an observer of this PersonalDataManager. | 97 // Removes |observer| as an observer of this PersonalDataManager. |
89 virtual void RemoveObserver(PersonalDataManagerObserver* observer); | 98 virtual void RemoveObserver(PersonalDataManagerObserver* observer); |
90 | 99 |
91 // Scans the given |form| for importable Autofill data. If the form includes | 100 // Scans the given |form| for importable Autofill data. If the form includes |
92 // sufficient address data for a new profile, it is immediately imported. If | 101 // sufficient address data for a new profile, it is immediately imported. If |
93 // the form includes sufficient credit card data for a new credit card, it is | 102 // the form includes sufficient credit card data for a new credit card, it is |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 // Whether we have already logged the number of local credit cards this | 486 // Whether we have already logged the number of local credit cards this |
478 // session. | 487 // session. |
479 mutable bool has_logged_credit_card_count_; | 488 mutable bool has_logged_credit_card_count_; |
480 | 489 |
481 // An observer to listen for changes to prefs::kAutofillEnabled. | 490 // An observer to listen for changes to prefs::kAutofillEnabled. |
482 std::unique_ptr<BooleanPrefMember> enabled_pref_; | 491 std::unique_ptr<BooleanPrefMember> enabled_pref_; |
483 | 492 |
484 // An observer to listen for changes to prefs::kAutofillWalletImportEnabled. | 493 // An observer to listen for changes to prefs::kAutofillWalletImportEnabled. |
485 std::unique_ptr<BooleanPrefMember> wallet_enabled_pref_; | 494 std::unique_ptr<BooleanPrefMember> wallet_enabled_pref_; |
486 | 495 |
| 496 // Set to true if autofill profile deduplication is enabled and needs to be |
| 497 // performed on the next data refresh. |
| 498 bool is_autofill_profile_dedupe_pending_ = false; |
| 499 |
487 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); | 500 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); |
488 }; | 501 }; |
489 | 502 |
490 } // namespace autofill | 503 } // namespace autofill |
491 | 504 |
492 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ | 505 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ |
OLD | NEW |