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

Unified Diff: chrome/browser/sync/glue/autofill_profile_data_type_controller.cc

Issue 10071033: RefCounted types should not have public destructors, chrome/browser/ part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implementation ordering fixes as well Created 8 years, 8 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_data_type_controller.cc
diff --git a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc
index 127adfce367399a7abea5fe5cad98feb0a1829f8..4e891e45ee554104c03a0b68e6597627005e9261 100644
--- a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc
+++ b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc
@@ -33,8 +33,45 @@ AutofillProfileDataTypeController::AutofillProfileDataTypeController(
personal_data_(NULL) {
}
+syncable::ModelType AutofillProfileDataTypeController::type() const {
+ return syncable::AUTOFILL_PROFILE;
+}
+
+browser_sync::ModelSafeGroup
+ AutofillProfileDataTypeController::model_safe_group() const {
+ return browser_sync::GROUP_DB;
+}
+
+void AutofillProfileDataTypeController::Observe(
+ int notification_type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
+ notification_registrar_.RemoveAll();
+ DoStartAssociationAsync();
+}
+
+void AutofillProfileDataTypeController::OnPersonalDataChanged() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_EQ(state(), MODEL_STARTING);
+ personal_data_->RemoveObserver(this);
+ web_data_service_ = profile()->GetWebDataService(Profile::IMPLICIT_ACCESS);
+ if (web_data_service_.get() && web_data_service_->IsDatabaseLoaded()) {
+ DoStartAssociationAsync();
+ } else {
+ notification_registrar_.Add(this, chrome::NOTIFICATION_WEB_DATABASE_LOADED,
+ content::NotificationService::AllSources());
+ }
+}
+
AutofillProfileDataTypeController::~AutofillProfileDataTypeController() {}
+bool AutofillProfileDataTypeController::PostTaskOnBackendThread(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ return BrowserThread::PostTask(BrowserThread::DB, from_here, task);
+}
+
bool AutofillProfileDataTypeController::StartModels() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_EQ(state(), MODEL_STARTING);
@@ -57,32 +94,11 @@ bool AutofillProfileDataTypeController::StartModels() {
}
}
-void AutofillProfileDataTypeController::OnPersonalDataChanged() {
+void AutofillProfileDataTypeController::StopModels() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK_EQ(state(), MODEL_STARTING);
- personal_data_->RemoveObserver(this);
- web_data_service_ = profile()->GetWebDataService(Profile::IMPLICIT_ACCESS);
- if (web_data_service_.get() && web_data_service_->IsDatabaseLoaded()) {
- DoStartAssociationAsync();
- } else {
- notification_registrar_.Add(this, chrome::NOTIFICATION_WEB_DATABASE_LOADED,
- content::NotificationService::AllSources());
- }
-}
-
-void AutofillProfileDataTypeController::Observe(
- int notification_type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
+ DCHECK(state() == STOPPING || state() == NOT_RUNNING);
notification_registrar_.RemoveAll();
- DoStartAssociationAsync();
-}
-
-bool AutofillProfileDataTypeController::PostTaskOnBackendThread(
- const tracked_objects::Location& from_here,
- const base::Closure& task) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- return BrowserThread::PostTask(BrowserThread::DB, from_here, task);
+ personal_data_->RemoveObserver(this);
}
void AutofillProfileDataTypeController::DoStartAssociationAsync() {
@@ -97,20 +113,4 @@ void AutofillProfileDataTypeController::DoStartAssociationAsync() {
}
}
-void AutofillProfileDataTypeController::StopModels() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(state() == STOPPING || state() == NOT_RUNNING);
- notification_registrar_.RemoveAll();
- personal_data_->RemoveObserver(this);
-}
-
-syncable::ModelType AutofillProfileDataTypeController::type() const {
- return syncable::AUTOFILL_PROFILE;
-}
-
-browser_sync::ModelSafeGroup
- AutofillProfileDataTypeController::model_safe_group() const {
- return browser_sync::GROUP_DB;
-}
-
} // namepsace browser_sync

Powered by Google App Engine
This is Rietveld 408576698