| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <functional> | 7 #include <functional> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/sync/internal_api/write_transaction.h" | 23 #include "chrome/browser/sync/internal_api/write_transaction.h" |
| 24 #include "chrome/browser/sync/profile_sync_service.h" | 24 #include "chrome/browser/sync/profile_sync_service.h" |
| 25 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" | 25 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" |
| 26 #include "chrome/browser/webdata/autofill_table.h" | 26 #include "chrome/browser/webdata/autofill_table.h" |
| 27 #include "chrome/browser/webdata/web_database.h" | 27 #include "chrome/browser/webdata/web_database.h" |
| 28 #include "chrome/common/guid.h" | 28 #include "chrome/common/guid.h" |
| 29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
| 30 #include "net/base/escape.h" | 30 #include "net/base/escape.h" |
| 31 | 31 |
| 32 using base::TimeTicks; | 32 using base::TimeTicks; |
| 33 using content::BrowserThread; |
| 33 | 34 |
| 34 namespace browser_sync { | 35 namespace browser_sync { |
| 35 | 36 |
| 36 const char kAutofillTag[] = "google_chrome_autofill"; | 37 const char kAutofillTag[] = "google_chrome_autofill"; |
| 37 const char kAutofillEntryNamespaceTag[] = "autofill_entry|"; | 38 const char kAutofillEntryNamespaceTag[] = "autofill_entry|"; |
| 38 | 39 |
| 39 struct AutofillModelAssociator::DataBundle { | 40 struct AutofillModelAssociator::DataBundle { |
| 40 std::set<AutofillKey> current_entries; | 41 std::set<AutofillKey> current_entries; |
| 41 std::vector<AutofillEntry> new_entries; | 42 std::vector<AutofillEntry> new_entries; |
| 42 std::set<string16> current_profiles; | 43 std::set<string16> current_profiles; |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 bool AutofillModelAssociator::CryptoReadyIfNecessary() { | 521 bool AutofillModelAssociator::CryptoReadyIfNecessary() { |
| 521 // We only access the cryptographer while holding a transaction. | 522 // We only access the cryptographer while holding a transaction. |
| 522 sync_api::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); | 523 sync_api::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); |
| 523 syncable::ModelTypeSet encrypted_types; | 524 syncable::ModelTypeSet encrypted_types; |
| 524 encrypted_types = sync_api::GetEncryptedTypes(&trans); | 525 encrypted_types = sync_api::GetEncryptedTypes(&trans); |
| 525 return encrypted_types.count(syncable::AUTOFILL) == 0 || | 526 return encrypted_types.count(syncable::AUTOFILL) == 0 || |
| 526 sync_service_->IsCryptographerReady(&trans); | 527 sync_service_->IsCryptographerReady(&trans); |
| 527 } | 528 } |
| 528 | 529 |
| 529 } // namespace browser_sync | 530 } // namespace browser_sync |
| OLD | NEW |