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_associator.h" | 5 #include "chrome/browser/sync/glue/autofill_model_associator.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 14 matching lines...) Expand all Loading... |
25 | 25 |
26 const char kAutofillTag[] = "google_chrome_autofill"; | 26 const char kAutofillTag[] = "google_chrome_autofill"; |
27 const char kAutofillEntryNamespaceTag[] = "autofill_entry|"; | 27 const char kAutofillEntryNamespaceTag[] = "autofill_entry|"; |
28 const char kAutofillProfileNamespaceTag[] = "autofill_profile|"; | 28 const char kAutofillProfileNamespaceTag[] = "autofill_profile|"; |
29 | 29 |
30 static const int kMaxNumAttemptsToFindUniqueLabel = 100; | 30 static const int kMaxNumAttemptsToFindUniqueLabel = 100; |
31 | 31 |
32 AutofillModelAssociator::AutofillModelAssociator( | 32 AutofillModelAssociator::AutofillModelAssociator( |
33 ProfileSyncService* sync_service, | 33 ProfileSyncService* sync_service, |
34 WebDatabase* web_database, | 34 WebDatabase* web_database, |
35 PersonalDataManager* personal_data, | 35 PersonalDataManager* personal_data) |
36 UnrecoverableErrorHandler* error_handler) | |
37 : sync_service_(sync_service), | 36 : sync_service_(sync_service), |
38 web_database_(web_database), | 37 web_database_(web_database), |
39 personal_data_(personal_data), | 38 personal_data_(personal_data), |
40 error_handler_(error_handler), | |
41 autofill_node_id_(sync_api::kInvalidId), | 39 autofill_node_id_(sync_api::kInvalidId), |
42 abort_association_pending_(false) { | 40 abort_association_pending_(false) { |
43 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); | 41 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); |
44 DCHECK(sync_service_); | 42 DCHECK(sync_service_); |
45 DCHECK(web_database_); | 43 DCHECK(web_database_); |
46 DCHECK(error_handler_); | |
47 DCHECK(personal_data_); | 44 DCHECK(personal_data_); |
48 } | 45 } |
49 | 46 |
50 AutofillModelAssociator::~AutofillModelAssociator() { | 47 AutofillModelAssociator::~AutofillModelAssociator() { |
51 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); | 48 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); |
52 } | 49 } |
53 | 50 |
54 bool AutofillModelAssociator::TraverseAndAssociateChromeAutofillEntries( | 51 bool AutofillModelAssociator::TraverseAndAssociateChromeAutofillEntries( |
55 sync_api::WriteTransaction* write_trans, | 52 sync_api::WriteTransaction* write_trans, |
56 const sync_api::ReadNode& autofill_root, | 53 const sync_api::ReadNode& autofill_root, |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 diff = MergeField(p, EMAIL_ADDRESS, s.email_address()) || diff; | 504 diff = MergeField(p, EMAIL_ADDRESS, s.email_address()) || diff; |
508 diff = MergeField(p, COMPANY_NAME, s.company_name()) || diff; | 505 diff = MergeField(p, COMPANY_NAME, s.company_name()) || diff; |
509 diff = MergeField(p, PHONE_FAX_WHOLE_NUMBER, s.phone_fax_whole_number()) | 506 diff = MergeField(p, PHONE_FAX_WHOLE_NUMBER, s.phone_fax_whole_number()) |
510 || diff; | 507 || diff; |
511 diff = MergeField(p, PHONE_HOME_WHOLE_NUMBER, s.phone_home_whole_number()) | 508 diff = MergeField(p, PHONE_HOME_WHOLE_NUMBER, s.phone_home_whole_number()) |
512 || diff; | 509 || diff; |
513 return diff; | 510 return diff; |
514 } | 511 } |
515 | 512 |
516 } // namespace browser_sync | 513 } // namespace browser_sync |
OLD | NEW |