| 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 #include "components/autofill/core/browser/webdata/autocomplete_sync_bridge.h" | 5 #include "components/autofill/core/browser/webdata/autocomplete_sync_bridge.h" |
| 6 | 6 |
| 7 #include <unordered_set> | 7 #include <unordered_set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 DCHECK(thread_checker_.CalledOnValidThread()); | 97 DCHECK(thread_checker_.CalledOnValidThread()); |
| 98 } | 98 } |
| 99 | 99 |
| 100 std::unique_ptr<syncer::MetadataChangeList> | 100 std::unique_ptr<syncer::MetadataChangeList> |
| 101 AutocompleteSyncBridge::CreateMetadataChangeList() { | 101 AutocompleteSyncBridge::CreateMetadataChangeList() { |
| 102 DCHECK(thread_checker_.CalledOnValidThread()); | 102 DCHECK(thread_checker_.CalledOnValidThread()); |
| 103 return base::MakeUnique<AutofillMetadataChangeList>(GetAutofillTable(), | 103 return base::MakeUnique<AutofillMetadataChangeList>(GetAutofillTable(), |
| 104 syncer::AUTOFILL); | 104 syncer::AUTOFILL); |
| 105 } | 105 } |
| 106 | 106 |
| 107 syncer::ModelError AutocompleteSyncBridge::MergeSyncData( | 107 base::Optional<syncer::ModelError> AutocompleteSyncBridge::MergeSyncData( |
| 108 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, | 108 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, |
| 109 syncer::EntityDataMap entity_data_map) { | 109 syncer::EntityDataMap entity_data_map) { |
| 110 DCHECK(thread_checker_.CalledOnValidThread()); | 110 DCHECK(thread_checker_.CalledOnValidThread()); |
| 111 NOTIMPLEMENTED(); | 111 NOTIMPLEMENTED(); |
| 112 return syncer::ModelError(); | 112 return {}; |
| 113 } | 113 } |
| 114 | 114 |
| 115 syncer::ModelError AutocompleteSyncBridge::ApplySyncChanges( | 115 base::Optional<syncer::ModelError> AutocompleteSyncBridge::ApplySyncChanges( |
| 116 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, | 116 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, |
| 117 syncer::EntityChangeList entity_changes) { | 117 syncer::EntityChangeList entity_changes) { |
| 118 DCHECK(thread_checker_.CalledOnValidThread()); | 118 DCHECK(thread_checker_.CalledOnValidThread()); |
| 119 NOTIMPLEMENTED(); | 119 NOTIMPLEMENTED(); |
| 120 return syncer::ModelError(); | 120 return {}; |
| 121 } | 121 } |
| 122 | 122 |
| 123 void AutocompleteSyncBridge::AutocompleteSyncBridge::GetData( | 123 void AutocompleteSyncBridge::AutocompleteSyncBridge::GetData( |
| 124 StorageKeyList storage_keys, | 124 StorageKeyList storage_keys, |
| 125 DataCallback callback) { | 125 DataCallback callback) { |
| 126 DCHECK(thread_checker_.CalledOnValidThread()); | 126 DCHECK(thread_checker_.CalledOnValidThread()); |
| 127 std::vector<AutofillEntry> entries; | 127 std::vector<AutofillEntry> entries; |
| 128 if (!GetAutofillTable()->GetAllAutofillEntries(&entries)) { | 128 if (!GetAutofillTable()->GetAllAutofillEntries(&entries)) { |
| 129 change_processor()->ReportError(FROM_HERE, | 129 change_processor()->ReportError(FROM_HERE, |
| 130 "Failed to load entries from table."); | 130 "Failed to load entries from table."); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 date_last_used = base::Time::FromInternalValue(*timestamps.rbegin()); | 199 date_last_used = base::Time::FromInternalValue(*timestamps.rbegin()); |
| 200 } | 200 } |
| 201 return AutofillEntry(key, date_created, date_last_used); | 201 return AutofillEntry(key, date_created, date_last_used); |
| 202 } | 202 } |
| 203 | 203 |
| 204 AutofillTable* AutocompleteSyncBridge::GetAutofillTable() const { | 204 AutofillTable* AutocompleteSyncBridge::GetAutofillTable() const { |
| 205 return AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase()); | 205 return AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase()); |
| 206 } | 206 } |
| 207 | 207 |
| 208 } // namespace autofill | 208 } // namespace autofill |
| OLD | NEW |