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 <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // Autofill. | 46 // Autofill. |
47 class PersonalDataManager : public KeyedService, | 47 class PersonalDataManager : public KeyedService, |
48 public WebDataServiceConsumer, | 48 public WebDataServiceConsumer, |
49 public AutofillWebDataServiceObserverOnUIThread { | 49 public AutofillWebDataServiceObserverOnUIThread { |
50 public: | 50 public: |
51 // A pair of GUID and variant index. Represents a single FormGroup and a | 51 // A pair of GUID and variant index. Represents a single FormGroup and a |
52 // specific data variant. | 52 // specific data variant. |
53 typedef std::pair<std::string, size_t> GUIDPair; | 53 typedef std::pair<std::string, size_t> GUIDPair; |
54 | 54 |
55 explicit PersonalDataManager(const std::string& app_locale); | 55 explicit PersonalDataManager(const std::string& app_locale); |
56 virtual ~PersonalDataManager(); | 56 ~PersonalDataManager() override; |
57 | 57 |
58 // Kicks off asynchronous loading of profiles and credit cards. | 58 // Kicks off asynchronous loading of profiles and credit cards. |
59 // |pref_service| must outlive this instance. |is_off_the_record| informs | 59 // |pref_service| must outlive this instance. |is_off_the_record| informs |
60 // this instance whether the user is currently operating in an off-the-record | 60 // this instance whether the user is currently operating in an off-the-record |
61 // context. | 61 // context. |
62 void Init(scoped_refptr<AutofillWebDataService> database, | 62 void Init(scoped_refptr<AutofillWebDataService> database, |
63 PrefService* pref_service, | 63 PrefService* pref_service, |
64 bool is_off_the_record); | 64 bool is_off_the_record); |
65 | 65 |
66 // WebDataServiceConsumer: | 66 // WebDataServiceConsumer: |
67 virtual void OnWebDataServiceRequestDone( | 67 void OnWebDataServiceRequestDone(WebDataServiceBase::Handle h, |
68 WebDataServiceBase::Handle h, | 68 const WDTypedResult* result) override; |
69 const WDTypedResult* result) override; | |
70 | 69 |
71 // AutofillWebDataServiceObserverOnUIThread: | 70 // AutofillWebDataServiceObserverOnUIThread: |
72 virtual void AutofillMultipleChanged() override; | 71 void AutofillMultipleChanged() override; |
73 | 72 |
74 // Adds a listener to be notified of PersonalDataManager events. | 73 // Adds a listener to be notified of PersonalDataManager events. |
75 virtual void AddObserver(PersonalDataManagerObserver* observer); | 74 virtual void AddObserver(PersonalDataManagerObserver* observer); |
76 | 75 |
77 // Removes |observer| as an observer of this PersonalDataManager. | 76 // Removes |observer| as an observer of this PersonalDataManager. |
78 virtual void RemoveObserver(PersonalDataManagerObserver* observer); | 77 virtual void RemoveObserver(PersonalDataManagerObserver* observer); |
79 | 78 |
80 // Scans the given |form| for importable Autofill data. If the form includes | 79 // Scans the given |form| for importable Autofill data. If the form includes |
81 // sufficient address data, it is immediately imported. If the form includes | 80 // sufficient address data, it is immediately imported. If the form includes |
82 // sufficient credit card data, it is stored into |credit_card|, so that we | 81 // sufficient credit card data, it is stored into |credit_card|, so that we |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 371 |
373 // An observer to listen for changes to prefs::kAutofillEnabled. | 372 // An observer to listen for changes to prefs::kAutofillEnabled. |
374 scoped_ptr<BooleanPrefMember> enabled_pref_; | 373 scoped_ptr<BooleanPrefMember> enabled_pref_; |
375 | 374 |
376 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); | 375 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); |
377 }; | 376 }; |
378 | 377 |
379 } // namespace autofill | 378 } // namespace autofill |
380 | 379 |
381 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ | 380 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ |
OLD | NEW |