summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/personal_data_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/autofill/personal_data_manager.h')
-rw-r--r--chrome/browser/autofill/personal_data_manager.h44
1 files changed, 17 insertions, 27 deletions
diff --git a/chrome/browser/autofill/personal_data_manager.h b/chrome/browser/autofill/personal_data_manager.h
index daf913b..a89f92b 100644
--- a/chrome/browser/autofill/personal_data_manager.h
+++ b/chrome/browser/autofill/personal_data_manager.h
@@ -82,8 +82,7 @@ class PersonalDataManager
void SaveImportedCreditCard();
// Sets |web_profiles_| to the contents of |profiles| and updates the web
- // database by adding, updating and removing profiles. Sets the unique ID of
- // newly-added profiles.
+ // database by adding, updating and removing profiles.
//
// The relationship between this and Refresh is subtle.
// A call to |SetProfiles| could include out-of-date data that may conflict
@@ -96,8 +95,7 @@ class PersonalDataManager
void SetProfiles(std::vector<AutoFillProfile>* profiles);
// Sets |credit_cards_| to the contents of |credit_cards| and updates the web
- // database by adding, updating and removing credit cards. Sets the unique
- // ID of newly-added profiles.
+ // database by adding, updating and removing credit cards.
void SetCreditCards(std::vector<CreditCard>* credit_cards);
// Adds |profile| to the web database.
@@ -106,12 +104,12 @@ class PersonalDataManager
// Updates |profile| which already exists in the web database.
void UpdateProfile(const AutoFillProfile& profile);
- // Removes the profile represented by |unique_id|.
- void RemoveProfile(int unique_id);
+ // Removes the profile represented by |guid|.
+ void RemoveProfile(const std::string& guid);
- // Returns the profile with the specified |unique_id|, or NULL if there is no
- // profile with the specified |unique_id|.
- AutoFillProfile* GetProfileById(int unique_id);
+ // Returns the profile with the specified |guid|, or NULL if there is no
+ // profile with the specified |guid|.
+ AutoFillProfile* GetProfileByGUID(const std::string& guid);
// Adds |credit_card| to the web database.
void AddCreditCard(const CreditCard& credit_card);
@@ -119,8 +117,12 @@ class PersonalDataManager
// Updates |credit_card| which already exists in the web database.
void UpdateCreditCard(const CreditCard& credit_card);
- // Removes the credit card represented by |unique_id|.
- void RemoveCreditCard(int unique_id);
+ // Removes the credit card represented by |guid|.
+ void RemoveCreditCard(const std::string& guid);
+
+ // Returns the credit card with the specified |guid|, or NULL if there is
+ // no credit card with the specified |guid|.
+ CreditCard* GetCreditCardByGUID(const std::string& guid);
// Gets the possible field types for the given text, determined by matching
// the text with all known personal information and returning matching types.
@@ -143,7 +145,7 @@ class PersonalDataManager
return credit_cards_.get();
}
- // Creates a profile labeled |label|, with it's own locally unique ID.
+ // Creates a profile labeled |label|.
// This must be called on the DB thread with the expectation that the
// returned form will be synchronously persisted to the WebDatabase. See
// Refresh and SetProfiles for details.
@@ -157,15 +159,6 @@ class PersonalDataManager
// engine processed a change from the cloud, we will learn of these as a
// result of this call.
//
- // Note that there is a subtle relationship with ID generation. IDs can be
- // generated by CreateNewEmptyAutoFillProfileForDBThread (in a synchronized
- // way), meaning that it is possible we are aware of this new profile only
- // by having it's ID tracked in unique_profile_ids_ for a period of time.
- // Because the expectation of that call is that the ID we generate will be
- // synchronously persisted to the DB, we are guaranteed to read it via
- // the next call to Refresh. It could get deleted before we
- // manage, but this is safe (we just hold on to the ID a bit longer).
- //
// Also see SetProfile for more details.
virtual void Refresh();
@@ -189,12 +182,6 @@ class PersonalDataManager
// Returns the profile of the tab contents.
Profile* profile();
- // This will create and reserve a new unique ID for the id pool |id_set|.
- // The |id_set| is typically |unique_profile_ids_| or
- // |unique_creditcard_ids_|. The global pool |unique_ids_| is used to ensure
- // uniqueness of ids across all pools. The new (next) unique id is returned.
- int CreateNextUniqueIDFor(std::set<int>* id_set);
-
// Loads the saved profiles from the web database.
virtual void LoadProfiles();
@@ -233,6 +220,7 @@ class PersonalDataManager
// True if personal data has been loaded from the web database.
bool is_data_loaded_;
+<<<<<<< HEAD
// The set of already created unique IDs, shared by both profiles and credit
// cards, since IDs must be unique among the two groups.
std::set<int> unique_ids_;
@@ -254,6 +242,8 @@ class PersonalDataManager
Lock unique_ids_lock_;
#endif
+=======
+>>>>>>> chromium.org at r65505
// The loaded web profiles.
ScopedVector<AutoFillProfile> web_profiles_;