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

Unified Diff: chrome/browser/password_manager/password_syncable_service.h

Issue 27233003: [Sync] Implementation of model association for passwords using sync API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 7 years, 2 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/password_manager/password_syncable_service.h
diff --git a/chrome/browser/password_manager/password_syncable_service.h b/chrome/browser/password_manager/password_syncable_service.h
index e4c84e699a9efe1312f81f28ab2f1ae8303c182c..0235d1c0785e76f3f9d80c4ee7f543448fd5af7c 100644
--- a/chrome/browser/password_manager/password_syncable_service.h
+++ b/chrome/browser/password_manager/password_syncable_service.h
@@ -31,6 +31,10 @@ class PasswordSyncableService : public syncer::SyncableService {
virtual ~PasswordSyncableService();
typedef std::vector<autofill::PasswordForm*> PasswordVector;
+ typedef std::map<std::string,
+ std::pair<syncer::SyncChange::SyncChangeType,
+ std::vector<autofill::PasswordForm*>::iterator > >
+ PasswordEntryMap;
// syncer::SyncableServiceImplementations
virtual syncer::SyncMergeResult MergeDataAndStartSyncing(
@@ -55,14 +59,27 @@ class PasswordSyncableService : public syncer::SyncableService {
const std::string& username_value,
const std::string& password_element,
const std::string& signon_realm);
+ // Static
Nicolas Zea 2013/10/15 22:04:10 Rebase onto your other patch?
lipalani1 2013/10/18 23:33:03 Done.
+ static syncer::SyncData PasswordSyncableService::CreateSyncData(
+ const autofill::PasswordForm& password);
+ // Static
+ static void ExtractPasswordFromSpecifics(
+ const sync_pb::PasswordSpecificsData& password,
+ autofill::PasswordForm* new_password);
private:
bool PasswordSyncableService::WriteToPasswordStore(
PasswordVector* new_entries,
PasswordVector* udpated_entries);
- syncer::SyncData PasswordSyncableService::CreateSyncData(
- const autofill::PasswordForm& password);
+ void CreateOrUpdateEntry(
+ const syncer::SyncData& data,
+ PasswordEntryMap* loaded_data,
+ std::vector<autofill::PasswordForm*>* new_entries,
+ std::vector<autofill::PasswordForm*>* udpated_entries);
+
+ // Virtual so tests can override.
+ virtual void NotifyPasswordStore();
scoped_ptr<syncer::SyncErrorFactory> sync_error_factory_;
scoped_ptr<syncer::SyncChangeProcessor> sync_processor_;

Powered by Google App Engine
This is Rietveld 408576698