| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #ifndef CHROME_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ | 4 #ifndef CHROME_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ |
| 5 #define CHROME_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ | 5 #define CHROME_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ |
| 6 #pragma once | 6 #pragma once |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // local->cloud syncs. Then for each cloud change we receive | 38 // local->cloud syncs. Then for each cloud change we receive |
| 39 // ProcessSyncChanges() and for each local change Observe() is called. | 39 // ProcessSyncChanges() and for each local change Observe() is called. |
| 40 class AutofillProfileSyncableService | 40 class AutofillProfileSyncableService |
| 41 : public syncer::SyncableService, | 41 : public syncer::SyncableService, |
| 42 public content::NotificationObserver, | 42 public content::NotificationObserver, |
| 43 public base::NonThreadSafe { | 43 public base::NonThreadSafe { |
| 44 public: | 44 public: |
| 45 explicit AutofillProfileSyncableService(WebDataService* web_data_service); | 45 explicit AutofillProfileSyncableService(WebDataService* web_data_service); |
| 46 virtual ~AutofillProfileSyncableService(); | 46 virtual ~AutofillProfileSyncableService(); |
| 47 | 47 |
| 48 static syncable::ModelType model_type() { return syncable::AUTOFILL_PROFILE; } | 48 static syncer::ModelType model_type() { return syncer::AUTOFILL_PROFILE; } |
| 49 | 49 |
| 50 // syncer::SyncableService implementation. | 50 // syncer::SyncableService implementation. |
| 51 virtual syncer::SyncError MergeDataAndStartSyncing( | 51 virtual syncer::SyncError MergeDataAndStartSyncing( |
| 52 syncable::ModelType type, | 52 syncer::ModelType type, |
| 53 const syncer::SyncDataList& initial_sync_data, | 53 const syncer::SyncDataList& initial_sync_data, |
| 54 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 54 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
| 55 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; | 55 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; |
| 56 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 56 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; |
| 57 virtual syncer::SyncDataList GetAllSyncData( | 57 virtual syncer::SyncDataList GetAllSyncData( |
| 58 syncable::ModelType type) const OVERRIDE; | 58 syncer::ModelType type) const OVERRIDE; |
| 59 virtual syncer::SyncError ProcessSyncChanges( | 59 virtual syncer::SyncError ProcessSyncChanges( |
| 60 const tracked_objects::Location& from_here, | 60 const tracked_objects::Location& from_here, |
| 61 const syncer::SyncChangeList& change_list) OVERRIDE; | 61 const syncer::SyncChangeList& change_list) OVERRIDE; |
| 62 | 62 |
| 63 // content::NotificationObserver implementation. | 63 // content::NotificationObserver implementation. |
| 64 virtual void Observe(int type, | 64 virtual void Observe(int type, |
| 65 const content::NotificationSource& source, | 65 const content::NotificationSource& source, |
| 66 const content::NotificationDetails& details) OVERRIDE; | 66 const content::NotificationDetails& details) OVERRIDE; |
| 67 | 67 |
| 68 protected: | 68 protected: |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 std::vector<AutofillProfile*> profiles_to_add; | 183 std::vector<AutofillProfile*> profiles_to_add; |
| 184 | 184 |
| 185 // When we go through sync we find profiles that are similar but unmatched. | 185 // When we go through sync we find profiles that are similar but unmatched. |
| 186 // Merge such profiles. | 186 // Merge such profiles. |
| 187 GUIDToProfileMap candidates_to_merge; | 187 GUIDToProfileMap candidates_to_merge; |
| 188 // Profiles that have multi-valued fields that are not in sync. | 188 // Profiles that have multi-valued fields that are not in sync. |
| 189 std::vector<AutofillProfile*> profiles_to_sync_back; | 189 std::vector<AutofillProfile*> profiles_to_sync_back; |
| 190 }; | 190 }; |
| 191 | 191 |
| 192 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ | 192 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_PROFILE_SYNCABLE_SERVICE_H_ |
| OLD | NEW |