Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1589)

Unified Diff: chrome/browser/sync/engine/syncapi.cc

Issue 5159001: Rest of the autofill work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch uploaded to debug why try servers have problem applying this patch. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/glue/autofill_change_processor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncapi.cc
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index 7965f651167a70c13fd457837585a1ba05cdbe9a..112878dc396b27bcbabee50d78b4a6698d7cb9ec 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -43,6 +43,7 @@
#include "chrome/browser/sync/protocol/theme_specifics.pb.h"
#include "chrome/browser/sync/protocol/typed_url_specifics.pb.h"
#include "chrome/browser/sync/sessions/sync_session_context.h"
+#include "chrome/browser/sync/syncable/autofill_migration.h"
#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/browser/sync/syncable/syncable.h"
#include "chrome/browser/sync/util/crypto_helpers.h"
@@ -375,6 +376,20 @@ void WriteNode::PutAutofillSpecificsAndMarkForSyncing(
PutSpecificsAndMarkForSyncing(entity_specifics);
}
+void WriteNode::SetAutofillProfileSpecifics(
+ const sync_pb::AutofillProfileSpecifics& new_value) {
+ DCHECK_EQ(GetModelType(), syncable::AUTOFILL_PROFILE);
+ PutAutofillProfileSpecificsAndMarkForSyncing(new_value);
+}
+
+void WriteNode::PutAutofillProfileSpecificsAndMarkForSyncing(
+ const sync_pb::AutofillProfileSpecifics& new_value) {
+ sync_pb::EntitySpecifics entity_specifics;
+ entity_specifics.MutableExtension(sync_pb::autofill_profile)->CopyFrom(
+ new_value);
+ PutSpecificsAndMarkForSyncing(entity_specifics);
+}
+
void WriteNode::SetBookmarkSpecifics(
const sync_pb::BookmarkSpecifics& new_value) {
DCHECK(GetModelType() == syncable::BOOKMARKS);
@@ -1094,6 +1109,50 @@ class SyncManager::SyncInternal
return true;
}
+ syncable::AutofillMigrationState GetAutofillMigrationState() {
+ syncable::ScopedDirLookup lookup(dir_manager(), username_for_share());
+ if (!lookup.good()) {
+ DCHECK(false) << "ScopedDirLookup failed when checking initial sync";
+ return syncable::NOT_MIGRATED;
+ }
+
+ return lookup->get_autofill_migration_state();
+ }
+
+ void SetAutofillMigrationState(syncable::AutofillMigrationState state) {
+ syncable::ScopedDirLookup lookup(dir_manager(), username_for_share());
+ if (!lookup.good()) {
+ DCHECK(false) << "ScopedDirLookup failed when checking initial sync";
+ return;
+ }
+
+ return lookup->set_autofill_migration_state(state);
+ }
+
+ void SetAutofillMigrationDebugInfo(
+ syncable::AutofillMigrationDebugInfo::PropertyToSet property_to_set,
+ const syncable::AutofillMigrationDebugInfo& info) {
+ syncable::ScopedDirLookup lookup(dir_manager(), username_for_share());
+ if (!lookup.good()) {
+ DCHECK(false) << "ScopedDirLookup failed when checking initial sync";
+ return;
+ }
+
+ return lookup->set_autofill_migration_state_debug_info(
+ property_to_set, info);
+ }
+
+ syncable::AutofillMigrationDebugInfo
+ GetAutofillMigrationDebugInfo() {
+ syncable::ScopedDirLookup lookup(dir_manager(), username_for_share());
+ if (!lookup.good()) {
+ DCHECK(false) << "ScopedDirLookup failed when checking initial sync";
+ syncable::AutofillMigrationDebugInfo null_value = {0};
+ return null_value;
+ }
+ return lookup->get_autofill_migration_debug_info();
+ }
+
// SyncEngineEventListener implementation.
virtual void OnSyncEngineEvent(const SyncEngineEvent& event);
private:
@@ -1315,6 +1374,27 @@ void SyncManager::StartSyncing() {
data_->StartSyncing();
}
+syncable::AutofillMigrationState
+ SyncManager::GetAutofillMigrationState() {
+ return data_->GetAutofillMigrationState();
+}
+
+void SyncManager::SetAutofillMigrationState(
+ syncable::AutofillMigrationState state) {
+ return data_->SetAutofillMigrationState(state);
+}
+
+syncable::AutofillMigrationDebugInfo
+ SyncManager::GetAutofillMigrationDebugInfo() {
+ return data_->GetAutofillMigrationDebugInfo();
+}
+
+void SyncManager::SetAutofillMigrationDebugInfo(
+ syncable::AutofillMigrationDebugInfo::PropertyToSet property_to_set,
+ const syncable::AutofillMigrationDebugInfo& info) {
+ return data_->SetAutofillMigrationDebugInfo(property_to_set, info);
+}
+
void SyncManager::SetPassphrase(const std::string& passphrase,
bool is_explicit) {
data_->SetPassphrase(passphrase, is_explicit);
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/glue/autofill_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698