| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "base/prefs/pref_member.h" | 15 #include "base/prefs/pref_member.h" |
| 16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 17 #include "components/autofill/core/browser/autofill_profile.h" | 17 #include "components/autofill/core/browser/autofill_profile.h" |
| 18 #include "components/autofill/core/browser/credit_card.h" | 18 #include "components/autofill/core/browser/credit_card.h" |
| 19 #include "components/autofill/core/browser/field_types.h" | 19 #include "components/autofill/core/browser/field_types.h" |
| 20 #include "components/autofill/core/browser/suggestion.h" | 20 #include "components/autofill/core/browser/suggestion.h" |
| 21 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 21 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 22 #include "components/autofill/core/browser/webdata/autofill_webdata_service_obse
rver.h" | 22 #include "components/autofill/core/browser/webdata/autofill_webdata_service_obse
rver.h" |
| 23 #include "components/keyed_service/core/keyed_service.h" | 23 #include "components/keyed_service/core/keyed_service.h" |
| 24 #include "components/webdata/common/web_data_service_consumer.h" | 24 #include "components/webdata/common/web_data_service_consumer.h" |
| 25 | 25 |
| 26 class Browser; |
| 26 class PrefService; | 27 class PrefService; |
| 27 class RemoveAutofillTester; | 28 class RemoveAutofillTester; |
| 28 | 29 |
| 29 namespace autofill { | 30 namespace autofill { |
| 30 class AutofillInteractiveTest; | 31 class AutofillInteractiveTest; |
| 31 class AutofillTest; | 32 class AutofillTest; |
| 32 class FormStructure; | 33 class FormStructure; |
| 33 class PersonalDataManagerObserver; | 34 class PersonalDataManagerObserver; |
| 34 class PersonalDataManagerFactory; | 35 class PersonalDataManagerFactory; |
| 35 } // namespace autofill | 36 } // namespace autofill |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 friend class autofill::AutofillTest; | 220 friend class autofill::AutofillTest; |
| 220 friend class autofill::PersonalDataManagerFactory; | 221 friend class autofill::PersonalDataManagerFactory; |
| 221 friend class PersonalDataManagerTest; | 222 friend class PersonalDataManagerTest; |
| 222 friend class ProfileSyncServiceAutofillTest; | 223 friend class ProfileSyncServiceAutofillTest; |
| 223 friend class ::RemoveAutofillTester; | 224 friend class ::RemoveAutofillTester; |
| 224 friend struct base::DefaultDeleter<PersonalDataManager>; | 225 friend struct base::DefaultDeleter<PersonalDataManager>; |
| 225 friend void autofill_helper::SetProfiles( | 226 friend void autofill_helper::SetProfiles( |
| 226 int, std::vector<autofill::AutofillProfile>*); | 227 int, std::vector<autofill::AutofillProfile>*); |
| 227 friend void autofill_helper::SetCreditCards( | 228 friend void autofill_helper::SetCreditCards( |
| 228 int, std::vector<autofill::CreditCard>*); | 229 int, std::vector<autofill::CreditCard>*); |
| 230 friend void SetTestProfiles( |
| 231 Browser* browser, std::vector<AutofillProfile>* profiles); |
| 229 | 232 |
| 230 // Sets |web_profiles_| to the contents of |profiles| and updates the web | 233 // Sets |web_profiles_| to the contents of |profiles| and updates the web |
| 231 // database by adding, updating and removing profiles. | 234 // database by adding, updating and removing profiles. |
| 232 // The relationship between this and Refresh is subtle. | 235 // The relationship between this and Refresh is subtle. |
| 233 // A call to |SetProfiles| could include out-of-date data that may conflict | 236 // A call to |SetProfiles| could include out-of-date data that may conflict |
| 234 // if we didn't refresh-to-latest before an Autofill window was opened for | 237 // if we didn't refresh-to-latest before an Autofill window was opened for |
| 235 // editing. |SetProfiles| is implemented to make a "best effort" to apply the | 238 // editing. |SetProfiles| is implemented to make a "best effort" to apply the |
| 236 // changes, but in extremely rare edge cases it is possible not all of the | 239 // changes, but in extremely rare edge cases it is possible not all of the |
| 237 // updates in |profiles| make it to the DB. This is why SetProfiles will | 240 // updates in |profiles| make it to the DB. This is why SetProfiles will |
| 238 // invoke Refresh after finishing, to ensure we get into a | 241 // invoke Refresh after finishing, to ensure we get into a |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 352 |
| 350 // An observer to listen for changes to prefs::kAutofillEnabled. | 353 // An observer to listen for changes to prefs::kAutofillEnabled. |
| 351 scoped_ptr<BooleanPrefMember> enabled_pref_; | 354 scoped_ptr<BooleanPrefMember> enabled_pref_; |
| 352 | 355 |
| 353 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); | 356 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); |
| 354 }; | 357 }; |
| 355 | 358 |
| 356 } // namespace autofill | 359 } // namespace autofill |
| 357 | 360 |
| 358 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ | 361 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ |
| OLD | NEW |