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

Unified Diff: chrome/browser/sync/profile_sync_factory_impl.cc

Issue 1851004: Adding sync support for Passwords (Closed)
Patch Set: Ready for checkin Created 10 years, 7 months 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/profile_sync_factory_impl.h ('k') | chrome/browser/sync/profile_sync_factory_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_factory_impl.cc
diff --git a/chrome/browser/sync/profile_sync_factory_impl.cc b/chrome/browser/sync/profile_sync_factory_impl.cc
index 3efbc761aa02fc14bcfea5ffd228b43e6e9221f9..e7b5e57bbbee966ef53fedef7bd378d98dbb475e 100644
--- a/chrome/browser/sync/profile_sync_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_factory_impl.cc
@@ -13,6 +13,9 @@
#include "chrome/browser/sync/glue/bookmark_data_type_controller.h"
#include "chrome/browser/sync/glue/bookmark_model_associator.h"
#include "chrome/browser/sync/glue/data_type_manager_impl.h"
+#include "chrome/browser/sync/glue/password_change_processor.h"
+#include "chrome/browser/sync/glue/password_data_type_controller.h"
+#include "chrome/browser/sync/glue/password_model_associator.h"
#include "chrome/browser/sync/glue/preference_change_processor.h"
#include "chrome/browser/sync/glue/preference_data_type_controller.h"
#include "chrome/browser/sync/glue/preference_model_associator.h"
@@ -37,6 +40,9 @@ using browser_sync::BookmarkModelAssociator;
using browser_sync::DataTypeController;
using browser_sync::DataTypeManager;
using browser_sync::DataTypeManagerImpl;
+using browser_sync::PasswordChangeProcessor;
+using browser_sync::PasswordDataTypeController;
+using browser_sync::PasswordModelAssociator;
using browser_sync::PreferenceChangeProcessor;
using browser_sync::PreferenceDataTypeController;
using browser_sync::PreferenceModelAssociator;
@@ -82,6 +88,13 @@ ProfileSyncService* ProfileSyncFactoryImpl::CreateProfileSyncService() {
new BookmarkDataTypeController(this, profile_, pss));
}
+ // Password sync is disabled by default. Register only if
+ // explicitly enabled.
+ if (command_line_->HasSwitch(switches::kEnableSyncPasswords)) {
+ pss->RegisterDataTypeController(
+ new PasswordDataTypeController(this, profile_, pss));
+ }
+
// Preference sync is enabled by default. Register unless explicitly
// disabled.
if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) {
@@ -144,6 +157,22 @@ ProfileSyncFactoryImpl::CreateBookmarkSyncComponents(
}
ProfileSyncFactory::SyncComponents
+ProfileSyncFactoryImpl::CreatePasswordSyncComponents(
+ ProfileSyncService* profile_sync_service,
+ PasswordStore* password_store,
+ UnrecoverableErrorHandler* error_handler) {
+ PasswordModelAssociator* model_associator =
+ new PasswordModelAssociator(profile_sync_service,
+ password_store,
+ error_handler);
+ PasswordChangeProcessor* change_processor =
+ new PasswordChangeProcessor(model_associator,
+ password_store,
+ error_handler);
+ return SyncComponents(model_associator, change_processor);
+}
+
+ProfileSyncFactory::SyncComponents
ProfileSyncFactoryImpl::CreatePreferenceSyncComponents(
ProfileSyncService* profile_sync_service,
UnrecoverableErrorHandler* error_handler) {
« no previous file with comments | « chrome/browser/sync/profile_sync_factory_impl.h ('k') | chrome/browser/sync/profile_sync_factory_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698