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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 abort_association_pending_ = true; | 386 abort_association_pending_ = true; |
387 } | 387 } |
388 | 388 |
389 const std::string* | 389 const std::string* |
390 AutofillModelAssociator::GetChromeNodeFromSyncId(int64 sync_id) { | 390 AutofillModelAssociator::GetChromeNodeFromSyncId(int64 sync_id) { |
391 SyncIdToAutofillMap::const_iterator iter = id_map_inverse_.find(sync_id); | 391 SyncIdToAutofillMap::const_iterator iter = id_map_inverse_.find(sync_id); |
392 return iter == id_map_inverse_.end() ? NULL : &(iter->second); | 392 return iter == id_map_inverse_.end() ? NULL : &(iter->second); |
393 } | 393 } |
394 | 394 |
395 bool AutofillModelAssociator::InitSyncNodeFromChromeId( | 395 bool AutofillModelAssociator::InitSyncNodeFromChromeId( |
396 std::string node_id, | 396 const std::string& node_id, |
397 sync_api::BaseNode* sync_node) { | 397 sync_api::BaseNode* sync_node) { |
398 return false; | 398 return false; |
399 } | 399 } |
400 | 400 |
401 int64 AutofillModelAssociator::GetSyncIdFromChromeId( | 401 int64 AutofillModelAssociator::GetSyncIdFromChromeId( |
402 const std::string autofill) { | 402 const std::string& autofill) { |
403 AutofillToSyncIdMap::const_iterator iter = id_map_.find(autofill); | 403 AutofillToSyncIdMap::const_iterator iter = id_map_.find(autofill); |
404 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second; | 404 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second; |
405 } | 405 } |
406 | 406 |
407 void AutofillModelAssociator::Associate( | 407 void AutofillModelAssociator::Associate( |
408 const std::string* autofill, int64 sync_id) { | 408 const std::string* autofill, int64 sync_id) { |
409 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 409 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
410 DCHECK_NE(sync_api::kInvalidId, sync_id); | 410 DCHECK_NE(sync_api::kInvalidId, sync_id); |
411 DCHECK(id_map_.find(*autofill) == id_map_.end()); | 411 DCHECK(id_map_.find(*autofill) == id_map_.end()); |
412 DCHECK(id_map_inverse_.find(sync_id) == id_map_inverse_.end()); | 412 DCHECK(id_map_inverse_.find(sync_id) == id_map_inverse_.end()); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 diff = MergeField(p, PHONE_HOME_WHOLE_NUMBER, s.phone_home_whole_number()) | 507 diff = MergeField(p, PHONE_HOME_WHOLE_NUMBER, s.phone_home_whole_number()) |
508 || diff; | 508 || diff; |
509 return diff; | 509 return diff; |
510 } | 510 } |
511 | 511 |
512 bool AutofillModelAssociator::HasNotMigratedYet() { | 512 bool AutofillModelAssociator::HasNotMigratedYet() { |
513 return true; | 513 return true; |
514 } | 514 } |
515 | 515 |
516 } // namespace browser_sync | 516 } // namespace browser_sync |
OLD | NEW |