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

Unified Diff: chrome/browser/sync/glue/autofill_profile_model_associator.h

Issue 5159001: Rest of the autofill work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Autofill code after fixing the lint errors. Created 10 years 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/sync/glue/autofill_profile_model_associator.h
diff --git a/chrome/browser/sync/glue/autofill_profile_model_associator.h b/chrome/browser/sync/glue/autofill_profile_model_associator.h
index 75c75efe1f4ef383fe42d24a5de3fa6aa6abdc16..acf2d4eebed59d96e39bf40687c1bf26f4c67540 100644
--- a/chrome/browser/sync/glue/autofill_profile_model_associator.h
+++ b/chrome/browser/sync/glue/autofill_profile_model_associator.h
@@ -1,6 +1,6 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// found in the LICENSE file.s
#ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_MODEL_ASSOCIATOR_H_
#define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_MODEL_ASSOCIATOR_H_
@@ -31,6 +31,8 @@ class WriteTransaction;
namespace browser_sync {
+extern const char kAutofillProfileTag[];
+
class AutofillChangeProcessor;
class UnrecoverableErrorHandler;
@@ -70,10 +72,7 @@ class AutofillProfileModelAssociator
// See ModelAssociator interface.
virtual void AbortAssociation();
- virtual const std::string* GetChromeNodeFromSyncId(
- int64 sync_id) {
- return NULL;
- }
+ virtual const std::string* GetChromeNodeFromSyncId(int64 sync_id);
virtual bool InitSyncNodeFromChromeId(std::string node_id,
sync_api::BaseNode* sync_node) {
@@ -94,23 +93,25 @@ class AutofillProfileModelAssociator
// given permanent tag was found and update
// |sync_id| with that node's id. No current use. To Implement
// only for completeness.
- virtual bool GetSyncIdForTaggedNode(const std::string& tag, int64* sync_id) {
- return false;
- }
+ virtual bool GetSyncIdForTaggedNode(const std::string& tag, int64* sync_id);
// Returns sync service instance.
ProfileSyncService* sync_service() { return sync_service_; }
+ static bool OverwriteProfileWithServerData(
+ AutoFillProfile* merge_into,
+ const sync_pb::AutofillProfileSpecifics& specifics);
+
lipalani 2010/12/09 19:45:25 remove the extra space here.
lipalani 2010/12/11 00:12:36 Done.
protected:
- AutofillProfileModelAssociator() {}
- bool TraverseAndAssociateChromeAutoFillProfiles(
- sync_api::WriteTransaction* write_trans,
- const sync_api::ReadNode& autofill_root,
- const std::vector<AutoFillProfile*>& all_profiles_from_db,
- std::set<std::string>* current_profiles,
- std::vector<AutoFillProfile*>* updated_profiles,
- std::vector<AutoFillProfile*>* new_profiles,
- std::vector<std::string>* profiles_to_delete);
+ AutofillProfileModelAssociator() {}
+ bool TraverseAndAssociateChromeAutoFillProfiles(
+ sync_api::WriteTransaction* write_trans,
+ const sync_api::ReadNode& autofill_root,
+ const std::vector<AutoFillProfile*>& all_profiles_from_db,
+ std::set<std::string>* current_profiles,
+ std::vector<AutoFillProfile*>* updated_profiles,
+ std::vector<AutoFillProfile*>* new_profiles,
+ std::vector<std::string>* profiles_to_delete);
// Helper to insert an AutoFillProfile into the WebDatabase (e.g. in response
// to encountering a sync node that doesn't exist yet locally).
@@ -137,10 +138,6 @@ class AutofillProfileModelAssociator
const sync_api::ReadNode& autofill_root,
DataBundle* bundle);
- static bool OverwriteProfileWithServerData(
- AutoFillProfile* merge_into,
- const sync_pb::AutofillProfileSpecifics& specifics);
-
private:
typedef std::map<std::string, int64> AutofillToSyncIdMap;
typedef std::map<int64, std::string> SyncIdToAutofillMap;
@@ -181,6 +178,7 @@ class AutofillProfileModelAssociator
// AssociateModels method as soon as possible.
Lock abort_association_pending_lock_;
bool abort_association_pending_;
+ int number_of_profiles_created_;
DISALLOW_COPY_AND_ASSIGN(AutofillProfileModelAssociator);
};

Powered by Google App Engine
This is Rietveld 408576698