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> | |
9 #include <string> | |
10 | |
8 #include "base/scoped_observer.h" | 11 #include "base/scoped_observer.h" |
9 #include "base/supports_user_data.h" | 12 #include "base/supports_user_data.h" |
10 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
11 #include "components/autofill/core/browser/webdata/autofill_change.h" | 14 #include "components/autofill/core/browser/webdata/autofill_change.h" |
12 #include "components/autofill/core/browser/webdata/autofill_webdata_service_obse rver.h" | 15 #include "components/autofill/core/browser/webdata/autofill_webdata_service_obse rver.h" |
13 #include "components/sync/model/metadata_change_list.h" | 16 #include "components/sync/model/metadata_change_list.h" |
14 #include "components/sync/model/model_type_sync_bridge.h" | 17 #include "components/sync/model/model_type_sync_bridge.h" |
15 | 18 |
16 namespace syncer { | 19 namespace syncer { |
17 class SyncError; | 20 class SyncError; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 syncer::SyncError ApplySyncChanges( | 52 syncer::SyncError ApplySyncChanges( |
50 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, | 53 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, |
51 syncer::EntityChangeList entity_changes) override; | 54 syncer::EntityChangeList entity_changes) override; |
52 void GetData(StorageKeyList storage_keys, DataCallback callback) override; | 55 void GetData(StorageKeyList storage_keys, DataCallback callback) override; |
53 void GetAllData(DataCallback callback) override; | 56 void GetAllData(DataCallback callback) override; |
54 // Generate a tag that uniquely identifies |entity_data| across all data | 57 // Generate a tag that uniquely identifies |entity_data| across all data |
55 // types. This is used to identify the entity on the server. The format, which | 58 // types. This is used to identify the entity on the server. The format, which |
56 // must remain the same for server compatibility, is: | 59 // must remain the same for server compatibility, is: |
57 // "autofill_entry|$name|$value" where $name and $value are escaped. | 60 // "autofill_entry|$name|$value" where $name and $value are escaped. |
58 std::string GetClientTag(const syncer::EntityData& entity_data) override; | 61 std::string GetClientTag(const syncer::EntityData& entity_data) override; |
59 // Generate a string key uniquely identifying |entity_data| in the context of | 62 // Generate a string key uniquely identifying |entity_data| in the context of |
skym
2016/12/23 00:34:09
I missed updating this comment.
| |
60 // local storage. The format, which should stay the same, is $name|$value" | 63 // local storage. The format, which should stay the same, is $name|$value" |
61 // where $name and $value are escaped. | 64 // where $name and $value are escaped. |
62 std::string GetStorageKey(const syncer::EntityData& entity_data) override; | 65 std::string GetStorageKey(const syncer::EntityData& entity_data) override; |
63 | 66 |
64 // AutofillWebDataServiceObserverOnDBThread implementation. | 67 // AutofillWebDataServiceObserverOnDBThread implementation. |
65 void AutofillEntriesChanged(const AutofillChangeList& changes) override; | 68 void AutofillEntriesChanged(const AutofillChangeList& changes) override; |
66 | 69 |
67 private: | 70 private: |
68 // Returns the table associated with the |web_data_backend_|. | 71 // Returns the table associated with the |web_data_backend_|. |
69 AutofillTable* GetAutofillTable() const; | 72 AutofillTable* GetAutofillTable() const; |
(...skipping 10 matching lines...) Expand all Loading... | |
80 // SupportsUserData, so it's guaranteed to outlive |this|. | 83 // SupportsUserData, so it's guaranteed to outlive |this|. |
81 AutofillWebDataBackend* const web_data_backend_; | 84 AutofillWebDataBackend* const web_data_backend_; |
82 | 85 |
83 ScopedObserver<AutofillWebDataBackend, AutocompleteSyncBridge> | 86 ScopedObserver<AutofillWebDataBackend, AutocompleteSyncBridge> |
84 scoped_observer_; | 87 scoped_observer_; |
85 }; | 88 }; |
86 | 89 |
87 } // namespace autofill | 90 } // namespace autofill |
88 | 91 |
89 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_ | 92 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_ |
OLD | NEW |