Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: chrome/browser/autofill/personal_data_manager.h

Issue 6676031: Autofill database migration to clean up bogus profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move to Lingesh's observer mechanism. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autofill/personal_data_manager.h
diff --git a/chrome/browser/autofill/personal_data_manager.h b/chrome/browser/autofill/personal_data_manager.h
index 67780937de500a0269d27f1ea63cc867112a0810..055c8c763548a36cb0f732cf19cfdf49417ec2c1 100644
--- a/chrome/browser/autofill/personal_data_manager.h
+++ b/chrome/browser/autofill/personal_data_manager.h
@@ -18,6 +18,7 @@
#include "chrome/browser/autofill/autofill_profile.h"
#include "chrome/browser/autofill/credit_card.h"
#include "chrome/browser/autofill/field_types.h"
+#include "chrome/browser/sync/profile_sync_service_observer.h"
#include "chrome/browser/webdata/web_data_service.h"
class AutofillManager;
@@ -31,6 +32,7 @@ class Profile;
class PersonalDataManager
: public WebDataServiceConsumer,
public AutoFillDialogObserver,
+ public ProfileSyncServiceObserver,
public base::RefCountedThreadSafe<PersonalDataManager> {
public:
// An interface the PersonalDataManager uses to notify its clients (observers)
@@ -64,6 +66,9 @@ class PersonalDataManager
// Removes |observer| as the observer of this PersonalDataManager.
virtual void RemoveObserver(PersonalDataManager::Observer* observer);
+ // ProfileSyncServiceObserver:
+ virtual void OnStateChanged();
+
// TODO(isherman): Update this comment
// If AutoFill is able to determine the field types of a significant number of
// field types that contain information in the FormStructures a profile will
@@ -150,6 +155,17 @@ class PersonalDataManager
// Kicks off asynchronous loading of profiles and credit cards.
void Init(Profile* profile);
+ // Checks suitability of |profile| for adding to the user's set of profiles.
+ static bool IsValidLearnableProfile(const AutofillProfile& profile);
+
+ // Merges |profile| into one of the |existing_profiles| if possible; otherwise
+ // appends |profile| to the end of that list. Fills |merged_profiles| with the
+ // result.
+ static bool MergeProfile(
+ const AutofillProfile& profile,
+ const std::vector<AutofillProfile*>& existing_profiles,
+ std::vector<AutofillProfile>* merged_profiles);
+
protected:
// Make sure that only Profile and certain tests can create an instance of
// PersonalDataManager.
@@ -194,12 +210,8 @@ class PersonalDataManager
// Saves |imported_profile| to the WebDB if it exists.
virtual void SaveImportedProfile(const AutofillProfile& imported_profile);
- // Merges |profile| into one of the |existing_profiles| if possible; otherwise
- // appends |profile| to the end of that list. Fills |merged_profiles| with the
- // result.
- bool MergeProfile(const AutofillProfile& profile,
- const std::vector<AutofillProfile*>& existing_profiles,
- std::vector<AutofillProfile>* merged_profiles);
+ // Notifies Sync about data migration if necessary.
+ void EmptyMigrationTrash();
// The first time this is called, logs an UMA metrics for the number of
// profiles the user has. On subsequent calls, does nothing.

Powered by Google App Engine
This is Rietveld 408576698