| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 << "might be running against an out-of-date server."; | 373 << "might be running against an out-of-date server."; |
| 374 return false; | 374 return false; |
| 375 } | 375 } |
| 376 | 376 |
| 377 // The sync model has user created nodes if the autofill folder has any | 377 // The sync model has user created nodes if the autofill folder has any |
| 378 // children. | 378 // children. |
| 379 *has_nodes = sync_api::kInvalidId != autofill_node.GetFirstChildId(); | 379 *has_nodes = sync_api::kInvalidId != autofill_node.GetFirstChildId(); |
| 380 return true; | 380 return true; |
| 381 } | 381 } |
| 382 | 382 |
| 383 bool AutofillModelAssociator::ChromeModelHasUserCreatedNodes(bool* has_nodes) { | |
| 384 DCHECK(has_nodes); | |
| 385 // Assume the autofill model always have user-created nodes. | |
| 386 *has_nodes = true; | |
| 387 return true; | |
| 388 } | |
| 389 | |
| 390 void AutofillModelAssociator::AbortAssociation() { | 383 void AutofillModelAssociator::AbortAssociation() { |
| 391 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 384 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
| 392 AutoLock lock(abort_association_pending_lock_); | 385 AutoLock lock(abort_association_pending_lock_); |
| 393 abort_association_pending_ = true; | 386 abort_association_pending_ = true; |
| 394 } | 387 } |
| 395 | 388 |
| 396 int64 AutofillModelAssociator::GetSyncIdFromChromeId( | 389 int64 AutofillModelAssociator::GetSyncIdFromChromeId( |
| 397 const std::string autofill) { | 390 const std::string autofill) { |
| 398 AutofillToSyncIdMap::const_iterator iter = id_map_.find(autofill); | 391 AutofillToSyncIdMap::const_iterator iter = id_map_.find(autofill); |
| 399 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second; | 392 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 diff = MergeField(p, EMAIL_ADDRESS, s.email_address()) || diff; | 497 diff = MergeField(p, EMAIL_ADDRESS, s.email_address()) || diff; |
| 505 diff = MergeField(p, COMPANY_NAME, s.company_name()) || diff; | 498 diff = MergeField(p, COMPANY_NAME, s.company_name()) || diff; |
| 506 diff = MergeField(p, PHONE_FAX_WHOLE_NUMBER, s.phone_fax_whole_number()) | 499 diff = MergeField(p, PHONE_FAX_WHOLE_NUMBER, s.phone_fax_whole_number()) |
| 507 || diff; | 500 || diff; |
| 508 diff = MergeField(p, PHONE_HOME_WHOLE_NUMBER, s.phone_home_whole_number()) | 501 diff = MergeField(p, PHONE_HOME_WHOLE_NUMBER, s.phone_home_whole_number()) |
| 509 || diff; | 502 || diff; |
| 510 return diff; | 503 return diff; |
| 511 } | 504 } |
| 512 | 505 |
| 513 } // namespace browser_sync | 506 } // namespace browser_sync |
| OLD | NEW |