OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 | 4 |
5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 std::unique_ptr<syncer::MetadataChangeList> CreateMetadataChangeList() | 47 std::unique_ptr<syncer::MetadataChangeList> CreateMetadataChangeList() |
48 override; | 48 override; |
49 base::Optional<syncer::ModelError> MergeSyncData( | 49 base::Optional<syncer::ModelError> MergeSyncData( |
50 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, | 50 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, |
51 syncer::EntityDataMap entity_data_map) override; | 51 syncer::EntityDataMap entity_data_map) override; |
52 base::Optional<syncer::ModelError> ApplySyncChanges( | 52 base::Optional<syncer::ModelError> ApplySyncChanges( |
53 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, | 53 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, |
54 syncer::EntityChangeList entity_changes) override; | 54 syncer::EntityChangeList entity_changes) override; |
55 void GetData(StorageKeyList storage_keys, DataCallback callback) override; | 55 void GetData(StorageKeyList storage_keys, DataCallback callback) override; |
56 void GetAllData(DataCallback callback) override; | 56 void GetAllData(DataCallback callback) override; |
57 // Generate a tag that uniquely identifies |entity_data| across all data | |
58 // types. This is used to identify the entity on the server. The format, which | |
59 // must remain the same for server compatibility, is: | |
60 // "autofill_entry|$name|$value" where $name and $value are escaped. | |
61 std::string GetClientTag(const syncer::EntityData& entity_data) override; | 57 std::string GetClientTag(const syncer::EntityData& entity_data) override; |
62 // Generate a string key uniquely identifying |entity_data| in the context of | |
63 // local storage. The format, which should stay the same, is $name|$value" | |
64 // where $name and $value are escaped. | |
65 std::string GetStorageKey(const syncer::EntityData& entity_data) override; | 58 std::string GetStorageKey(const syncer::EntityData& entity_data) override; |
66 | 59 |
67 // AutofillWebDataServiceObserverOnDBThread implementation. | 60 // AutofillWebDataServiceObserverOnDBThread implementation. |
68 void AutofillEntriesChanged(const AutofillChangeList& changes) override; | 61 void AutofillEntriesChanged(const AutofillChangeList& changes) override; |
69 | 62 |
70 private: | 63 private: |
71 // Returns the table associated with the |web_data_backend_|. | 64 // Returns the table associated with the |web_data_backend_|. |
72 AutofillTable* GetAutofillTable() const; | 65 AutofillTable* GetAutofillTable() const; |
73 | 66 |
74 // Respond to local autofill entries changing by notifying sync of the | 67 // Respond to local autofill entries changing by notifying sync of the |
(...skipping 12 matching lines...) Expand all Loading... |
87 | 80 |
88 ScopedObserver<AutofillWebDataBackend, AutocompleteSyncBridge> | 81 ScopedObserver<AutofillWebDataBackend, AutocompleteSyncBridge> |
89 scoped_observer_; | 82 scoped_observer_; |
90 | 83 |
91 DISALLOW_COPY_AND_ASSIGN(AutocompleteSyncBridge); | 84 DISALLOW_COPY_AND_ASSIGN(AutocompleteSyncBridge); |
92 }; | 85 }; |
93 | 86 |
94 } // namespace autofill | 87 } // namespace autofill |
95 | 88 |
96 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_ | 89 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_ |
OLD | NEW |