Index: chrome/browser/sync/glue/autofill_model_associator.h |
diff --git a/chrome/browser/sync/glue/autofill_model_associator.h b/chrome/browser/sync/glue/autofill_model_associator.h |
index d4e53630ff3aa0c610447c46ba7be688e912ed80..d196e52efdc73e4456942a6c2be9239661cbae72 100644 |
--- a/chrome/browser/sync/glue/autofill_model_associator.h |
+++ b/chrome/browser/sync/glue/autofill_model_associator.h |
@@ -16,6 +16,7 @@ |
#include "base/ref_counted.h" |
#include "chrome/browser/autofill/personal_data_manager.h" |
#include "chrome/browser/sync/engine/syncapi.h" |
+#include "chrome/browser/sync/glue/autofill_model_associator2.h" |
#include "chrome/browser/sync/glue/model_associator.h" |
#include "chrome/browser/sync/protocol/autofill_specifics.pb.h" |
#include "chrome/browser/webdata/autofill_entry.h" |
@@ -99,7 +100,6 @@ class AutofillModelAssociator |
virtual bool GetSyncIdForTaggedNode(const std::string& tag, int64* sync_id); |
static std::string KeyToTag(const string16& name, const string16& value); |
- static std::string ProfileLabelToTag(const string16& label); |
static bool MergeTimestamps(const sync_pb::AutofillSpecifics& autofill, |
const std::vector<base::Time>& timestamps, |
@@ -114,15 +114,16 @@ class AutofillModelAssociator |
// Returns sync service instance. |
ProfileSyncService* sync_service() { return sync_service_; } |
- // Compute and apply suffix to a label so that the resulting label is |
- // unique in the sync database. |
- // |new_non_unique_label| is the colliding label which is to be uniquified. |
- // |existing_unique_label| is the current label of the object, if any; this |
- // is treated as a unique label even if colliding. If no such label is |
- // available, |existing_unique_label| may be empty. |
- static string16 MakeUniqueLabel(const string16& new_non_unique_label, |
- const string16& existing_unique_label, |
- sync_api::BaseTransaction* trans); |
+ protected: |
+ // Is called to determine if we need to upgrade to the new |
+ // autofillprofile2 data type. If so we need to sync up autofillprofile |
+ // first to the latest available changes on the server and then upgrade |
+ // to autofillprofile2. |
+ virtual bool IsUpgrading(); |
+ |
+ AutoFillProfile* FindCorrespondingNodeFromWebDB( |
+ const sync_pb::AutofillProfileSpecifics& profile, |
+ const std::vector<AutoFillProfile*>& all_profiles_from_db); |
private: |
typedef std::map<std::string, int64> AutofillToSyncIdMap; |
@@ -156,7 +157,8 @@ class AutofillModelAssociator |
bool TraverseAndAssociateAllSyncNodes( |
sync_api::WriteTransaction* write_trans, |
const sync_api::ReadNode& autofill_root, |
- DataBundle* bundle); |
+ DataBundle* bundle, |
+ std::vector<AutoFillProfile*>& all_profiles_from_db); |
// Helper to persist any changes that occured during model association to |
// the WebDatabase. |
@@ -173,7 +175,8 @@ class AutofillModelAssociator |
void AddNativeProfileIfNeeded( |
const sync_pb::AutofillProfileSpecifics& profile, |
DataBundle* bundle, |
- const sync_api::ReadNode& node); |
+ const sync_api::ReadNode& node, |
+ std::vector<AutoFillProfile*>& all_profiles_from_db); |
// Helper to insert a sync node for the given AutoFillProfile (e.g. in |
// response to encountering a native profile that doesn't exist yet in the |