OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/sync/glue/autofill_model_associator2.h" | 5 #include "chrome/browser/sync/glue/autofill_model_associator2.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/task.h" | 9 #include "base/task.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 bool AutofillModelAssociator2::MakeNewAutofillProfileSyncNode( | 207 bool AutofillModelAssociator2::MakeNewAutofillProfileSyncNode( |
208 sync_api::WriteTransaction* trans, const sync_api::BaseNode& autofill_root, | 208 sync_api::WriteTransaction* trans, const sync_api::BaseNode& autofill_root, |
209 const std::string& tag, const AutoFillProfile& profile, int64* sync_id) { | 209 const std::string& tag, const AutoFillProfile& profile, int64* sync_id) { |
210 sync_api::WriteNode node(trans); | 210 sync_api::WriteNode node(trans); |
211 if (!node.InitUniqueByCreation(syncable::AUTOFILL, autofill_root, tag)) { | 211 if (!node.InitUniqueByCreation(syncable::AUTOFILL, autofill_root, tag)) { |
212 LOG(ERROR) << "Failed to create autofill sync node."; | 212 LOG(ERROR) << "Failed to create autofill sync node."; |
213 return false; | 213 return false; |
214 } | 214 } |
215 node.SetTitle(UTF8ToWide(tag)); | 215 node.SetTitle(UTF8ToWide(tag)); |
216 AutofillChangeProcessor::WriteAutofillProfile(profile, &node); | 216 AutofillChangeProcessor2::WriteAutofillProfile(profile, &node); |
217 *sync_id = node.GetId(); | 217 *sync_id = node.GetId(); |
218 return true; | 218 return true; |
219 } | 219 } |
220 | 220 |
221 | 221 |
222 bool AutofillModelAssociator2::LoadAutofillData( | 222 bool AutofillModelAssociator2::LoadAutofillData( |
223 std::vector<AutofillEntry>* entries, | 223 std::vector<AutofillEntry>* entries, |
224 std::vector<AutoFillProfile*>* profiles) { | 224 std::vector<AutoFillProfile*>* profiles) { |
225 if (IsAbortPending()) | 225 if (IsAbortPending()) |
226 return false; | 226 return false; |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 diff = MergeField2(p, EMAIL_ADDRESS, s.email_address()) || diff; | 537 diff = MergeField2(p, EMAIL_ADDRESS, s.email_address()) || diff; |
538 diff = MergeField2(p, COMPANY_NAME, s.company_name()) || diff; | 538 diff = MergeField2(p, COMPANY_NAME, s.company_name()) || diff; |
539 diff = MergeField2(p, PHONE_FAX_WHOLE_NUMBER, s.phone_fax_whole_number()) | 539 diff = MergeField2(p, PHONE_FAX_WHOLE_NUMBER, s.phone_fax_whole_number()) |
540 || diff; | 540 || diff; |
541 diff = MergeField2(p, PHONE_HOME_WHOLE_NUMBER, s.phone_home_whole_number()) | 541 diff = MergeField2(p, PHONE_HOME_WHOLE_NUMBER, s.phone_home_whole_number()) |
542 || diff; | 542 || diff; |
543 return diff; | 543 return diff; |
544 } | 544 } |
545 | 545 |
546 } // namespace browser_sync | 546 } // namespace browser_sync |
OLD | NEW |