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

Unified Diff: chrome/browser/sync/glue/autofill_profile_change_processor.h

Issue 7819002: Migrate AutofillProfile sync to new API. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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
Index: chrome/browser/sync/glue/autofill_profile_change_processor.h
===================================================================
--- chrome/browser/sync/glue/autofill_profile_change_processor.h (revision 99989)
+++ chrome/browser/sync/glue/autofill_profile_change_processor.h (working copy)
@@ -1,114 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_CHANGE_PROCESSOR_H_
-#define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_CHANGE_PROCESSOR_H_
-#pragma once
-#include <string>
-#include <vector>
-
-#include "chrome/browser/autofill/autofill_profile.h"
-#include "chrome/browser/autofill/personal_data_manager.h"
-#include "chrome/browser/sync/glue/autofill_profile_model_associator.h"
-#include "chrome/browser/sync/glue/change_processor.h"
-#include "chrome/browser/sync/internal_api/sync_manager.h"
-#include "chrome/browser/sync/unrecoverable_error_handler.h"
-#include "chrome/browser/webdata/autofill_change.h"
-#include "chrome/browser/webdata/web_database.h"
-#include "content/common/content_notification_types.h"
-#include "content/common/notification_observer.h"
-#include "content/common/notification_registrar.h"
-#include "content/common/notification_service.h"
-
-namespace sync_api {
-class ReadNode;
-class WriteNode;
-class WriteTransaction;
-} // namespace sync_api
-
-namespace browser_sync {
-
-class AutofillProfileChangeProcessor : public ChangeProcessor,
- public NotificationObserver {
- public:
- AutofillProfileChangeProcessor(
- AutofillProfileModelAssociator *model_associator,
- WebDatabase* web_database,
- PersonalDataManager* personal_data_manager,
- UnrecoverableErrorHandler* error_handler);
-
- virtual ~AutofillProfileChangeProcessor();
-
- // Virtual methods from ChangeProcessor class.
- virtual void ApplyChangesFromSyncModel(
- const sync_api::BaseTransaction *write_trans,
- const sync_api::SyncManager::ChangeRecord* changes,
- int change_count);
-
- virtual void CommitChangesFromSyncModel();
-
- // Virtual method implemented for the observer class.
- virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details);
-
-
- static void WriteAutofillProfile(const AutofillProfile& profile,
- sync_api::WriteNode* node);
-
- protected:
- // Protected methods from ChangeProcessor.
- virtual void StartImpl(Profile* profile) {}
- virtual void StopImpl() {}
-
- struct AutofillProfileChangeRecord {
- sync_api::SyncManager::ChangeRecord::Action action_;
- int64 id_;
- sync_pb::AutofillProfileSpecifics profile_specifics_;
- AutofillProfileChangeRecord(
- sync_api::SyncManager::ChangeRecord::Action action,
- int64 id,
- const sync_pb::AutofillProfileSpecifics& profile_specifics)
- : action_(action),
- id_(id),
- profile_specifics_(profile_specifics) {}
- };
-
- std::vector<AutofillProfileChangeRecord> autofill_changes_;
-
- virtual void AddAutofillProfileSyncNode(sync_api::WriteTransaction* trans,
- sync_api::BaseNode& autofill_profile_root,
- const AutofillProfile& profile);
-
- void ActOnChange(AutofillProfileChange* change,
- sync_api::WriteTransaction* trans,
- sync_api::ReadNode& autofill_root);
-
- private:
- friend class ScopedStopObserving<AutofillProfileChangeProcessor>;
-
- void StartObserving();
- void StopObserving();
-
- void PostOptimisticRefreshTask();
-
- void ApplyAutofillProfileChange(
- sync_api::SyncManager::ChangeRecord::Action action,
- const sync_pb::AutofillProfileSpecifics& profile,
- int64 sync_id);
-
- void RemoveSyncNode(
- const std::string& guid, sync_api::WriteTransaction *trans);
-
- AutofillProfileModelAssociator* model_associator_;
- bool observing_;
-
- WebDatabase* web_database_;
- PersonalDataManager* personal_data_;
- NotificationRegistrar notification_registrar_;
-};
-
-} // namespace browser_sync
-
-#endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_CHANGE_PROCESSOR_H_

Powered by Google App Engine
This is Rietveld 408576698