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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 5159001: Rest of the autofill work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Autofill code after fixing the lint errors. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 registrar_.workers[GROUP_PASSWORD] = NULL; 244 registrar_.workers[GROUP_PASSWORD] = NULL;
245 registrar_.workers.erase(GROUP_DB); 245 registrar_.workers.erase(GROUP_DB);
246 registrar_.workers.erase(GROUP_HISTORY); 246 registrar_.workers.erase(GROUP_HISTORY);
247 registrar_.workers.erase(GROUP_UI); 247 registrar_.workers.erase(GROUP_UI);
248 registrar_.workers.erase(GROUP_PASSIVE); 248 registrar_.workers.erase(GROUP_PASSIVE);
249 registrar_.workers.erase(GROUP_PASSWORD); 249 registrar_.workers.erase(GROUP_PASSWORD);
250 frontend_ = NULL; 250 frontend_ = NULL;
251 core_ = NULL; // Releases reference to core_. 251 core_ = NULL; // Releases reference to core_.
252 } 252 }
253 253
254 syncable::Directory::PersistedKernelInfo::AutofillMigrationState
255 SyncBackendHost::GetAutofillMigrationState() {
256 return core_->syncapi()->GetAutofillMigrationState();
257 }
258
259 void SyncBackendHost::SetAutofillMigrationState(
260 syncable::Directory::PersistedKernelInfo::AutofillMigrationState state) {
261 return core_->syncapi()->SetAutofillMigrationState(state);
262 }
263
264 syncable::AutofillMigrationDebugInfo
265 SyncBackendHost::GetAutofillMigrationDebugInfo() {
266 return core_->syncapi()->GetAutofillMigrationDebugInfo();
267 }
268
269 void SyncBackendHost::SetAutofillMigrationDebugInfo(
270 syncable::AutofillMigrationDebugInfo::PropertyToSet property_to_set,
271 const syncable::AutofillMigrationDebugInfo& info) {
272 return core_->syncapi()->SetAutofillMigrationDebugInfo(property_to_set, info);
273 }
274
254 void SyncBackendHost::ConfigureDataTypes(const syncable::ModelTypeSet& types, 275 void SyncBackendHost::ConfigureDataTypes(const syncable::ModelTypeSet& types,
255 CancelableTask* ready_task) { 276 CancelableTask* ready_task) {
256 // Only one configure is allowed at a time. 277 // Only one configure is allowed at a time.
257 DCHECK(!configure_ready_task_.get()); 278 DCHECK(!configure_ready_task_.get());
258 DCHECK(syncapi_initialized_); 279 DCHECK(syncapi_initialized_);
259 280
281 core_->syncapi()->ConfigureAutofillMigration();
282
260 bool deleted_type = false; 283 bool deleted_type = false;
261 284
262 { 285 {
263 AutoLock lock(registrar_lock_); 286 AutoLock lock(registrar_lock_);
264 for (DataTypeController::TypeMap::const_iterator it = 287 for (DataTypeController::TypeMap::const_iterator it =
265 data_type_controllers_.begin(); 288 data_type_controllers_.begin();
266 it != data_type_controllers_.end(); ++it) { 289 it != data_type_controllers_.end(); ++it) {
267 syncable::ModelType type = (*it).first; 290 syncable::ModelType type = (*it).first;
268 291
269 // If a type is not specified, remove it from the routing_info. 292 // If a type is not specified, remove it from the routing_info.
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 } 841 }
819 842
820 void SyncBackendHost::Core::DeleteSyncDataFolder() { 843 void SyncBackendHost::Core::DeleteSyncDataFolder() {
821 if (file_util::DirectoryExists(host_->sync_data_folder_path())) { 844 if (file_util::DirectoryExists(host_->sync_data_folder_path())) {
822 if (!file_util::Delete(host_->sync_data_folder_path(), true)) 845 if (!file_util::Delete(host_->sync_data_folder_path(), true))
823 LOG(DFATAL) << "Could not delete the Sync Data folder."; 846 LOG(DFATAL) << "Could not delete the Sync Data folder.";
824 } 847 }
825 } 848 }
826 849
827 } // namespace browser_sync 850 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698