diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-10 15:52:27 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-10 15:52:27 +0000 |
commit | 43211582b1fa8c69136385250e7b0446cf364b5c (patch) | |
tree | 655ab01543012b6fd5699dee8fab92876959b7d9 /chrome/browser/sync/glue | |
parent | d43970a7ceee5fc5433787b0f28b64234a4039f2 (diff) | |
download | chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.zip chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.tar.gz chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.tar.bz2 |
Moving notification types which are chrome specific to a new header file chrome_notification_types.h.
This file lives in chrome\common. The chrome specific notifications start from NOTIFICATION_CONTENT_END
which defines the end of the enum used by content to define notification types. The notificaton_type.h file
in content\common has been renamed to content_notification_types.h
BUG=76698
Review URL: http://codereview.chromium.org/7327007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/glue')
31 files changed, 132 insertions, 123 deletions
diff --git a/chrome/browser/sync/glue/app_change_processor.cc b/chrome/browser/sync/glue/app_change_processor.cc index b786aab..31e2624 100644 --- a/chrome/browser/sync/glue/app_change_processor.cc +++ b/chrome/browser/sync/glue/app_change_processor.cc @@ -14,6 +14,7 @@ #include "chrome/browser/sync/glue/extension_sync.h" #include "chrome/browser/sync/glue/extension_util.h" #include "chrome/browser/sync/protocol/extension_specifics.pb.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "content/browser/browser_thread.h" #include "content/common/notification_details.h" @@ -39,24 +40,24 @@ AppChangeProcessor::~AppChangeProcessor() { // the browser or the syncapi are done in order; this is tricky since // some events (e.g., extension installation) are done asynchronously. -void AppChangeProcessor::Observe(NotificationType type, +void AppChangeProcessor::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(running()); DCHECK(profile_); - if ((type != NotificationType::EXTENSION_LOADED) && - (type != NotificationType::EXTENSION_UPDATE_DISABLED) && - (type != NotificationType::EXTENSION_UNLOADED)) { + if ((type != chrome::NOTIFICATION_EXTENSION_LOADED) && + (type != chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED) && + (type != chrome::NOTIFICATION_EXTENSION_UNLOADED)) { LOG(DFATAL) << "Received unexpected notification of type " - << type.value; + << type; return; } // Filter out unhandled extensions first. DCHECK_EQ(Source<Profile>(source).ptr(), profile_); const Extension& extension = - (type == NotificationType::EXTENSION_UNLOADED) ? + (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) ? *Details<UnloadedExtensionInfo>(details)->extension : *Details<const Extension>(details).ptr(); if (!traits_.is_valid_and_syncable(extension)) { @@ -66,7 +67,7 @@ void AppChangeProcessor::Observe(NotificationType type, const std::string& id = extension.id(); // Then handle extension uninstalls. - if (type == NotificationType::EXTENSION_UNLOADED) { + if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) { const UnloadedExtensionInfo& info = *Details<UnloadedExtensionInfo>(details).ptr(); if (info.reason == UnloadedExtensionInfo::UNINSTALL) { @@ -78,7 +79,7 @@ void AppChangeProcessor::Observe(NotificationType type, } VLOG(1) << "Updating server data for extension " << id - << " (notification type = " << type.value << ")"; + << " (notification type = " << type << ")"; std::string error; if (!UpdateServerData(traits_, extension, *extension_service_, share_handle(), &error)) { @@ -163,16 +164,16 @@ void AppChangeProcessor::StartObserving() { DCHECK(profile_); notification_registrar_.Add( - this, NotificationType::EXTENSION_LOADED, + this, chrome::NOTIFICATION_EXTENSION_LOADED, Source<Profile>(profile_)); // Despite the name, this notification is exactly like // EXTENSION_LOADED but with an initial state of DISABLED. notification_registrar_.Add( - this, NotificationType::EXTENSION_UPDATE_DISABLED, + this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, Source<Profile>(profile_)); notification_registrar_.Add( - this, NotificationType::EXTENSION_UNLOADED, + this, chrome::NOTIFICATION_EXTENSION_UNLOADED, Source<Profile>(profile_)); } diff --git a/chrome/browser/sync/glue/app_change_processor.h b/chrome/browser/sync/glue/app_change_processor.h index 80511eb..7c2ce3e 100644 --- a/chrome/browser/sync/glue/app_change_processor.h +++ b/chrome/browser/sync/glue/app_change_processor.h @@ -10,9 +10,9 @@ #include "chrome/browser/sync/engine/syncapi.h" #include "chrome/browser/sync/glue/change_processor.h" #include "chrome/browser/sync/glue/extension_sync_traits.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" -#include "content/common/notification_type.h" class ExtensionServiceInterface; @@ -33,7 +33,7 @@ class AppChangeProcessor : public ChangeProcessor, // NotificationObserver implementation. // BrowserExtensionProvider -> sync_api model change application. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/sync/glue/autofill_change_processor.cc b/chrome/browser/sync/glue/autofill_change_processor.cc index 62b2de1..ae18d13 100644 --- a/chrome/browser/sync/glue/autofill_change_processor.cc +++ b/chrome/browser/sync/glue/autofill_change_processor.cc @@ -19,6 +19,7 @@ #include "chrome/browser/webdata/autofill_change.h" #include "chrome/browser/webdata/web_data_service.h" #include "chrome/browser/webdata/web_database.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/guid.h" #include "content/common/notification_service.h" @@ -55,7 +56,7 @@ AutofillChangeProcessor::AutofillChangeProcessor( AutofillChangeProcessor::~AutofillChangeProcessor() {} -void AutofillChangeProcessor::Observe(NotificationType type, +void AutofillChangeProcessor::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { // Ensure this notification came from our web database. @@ -77,7 +78,7 @@ void AutofillChangeProcessor::Observe(NotificationType type, return; } - DCHECK(type.value == NotificationType::AUTOFILL_ENTRIES_CHANGED); + DCHECK(type == chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED); AutofillChangeList* changes = Details<AutofillChangeList>(details).ptr(); ObserveAutofillEntriesChanged(changes, &trans, autofill_root); @@ -419,7 +420,8 @@ void AutofillChangeProcessor::StopImpl() { void AutofillChangeProcessor::StartObserving() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); - notification_registrar_.Add(this, NotificationType::AUTOFILL_ENTRIES_CHANGED, + notification_registrar_.Add(this, + chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, NotificationService::AllSources()); } diff --git a/chrome/browser/sync/glue/autofill_change_processor.h b/chrome/browser/sync/glue/autofill_change_processor.h index 914feca..1ea0e1a 100644 --- a/chrome/browser/sync/glue/autofill_change_processor.h +++ b/chrome/browser/sync/glue/autofill_change_processor.h @@ -44,7 +44,7 @@ class AutofillChangeProcessor : public ChangeProcessor, // NotificationObserver implementation. // WebDataService -> sync_api model change application. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.cc b/chrome/browser/sync/glue/autofill_data_type_controller.cc index 794c3d0..ba6a161 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller.cc @@ -10,10 +10,10 @@ #include "chrome/browser/sync/profile_sync_factory.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/webdata/web_data_service.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" namespace browser_sync { @@ -45,7 +45,7 @@ bool AutofillDataTypeController::StartModels() { if (web_data_service_.get() && web_data_service_->IsDatabaseLoaded()) { return true; } else { - notification_registrar_.Add(this, NotificationType::WEB_DATABASE_LOADED, + notification_registrar_.Add(this, chrome::NOTIFICATION_WEB_DATABASE_LOADED, NotificationService::AllSources()); return false; } @@ -62,12 +62,12 @@ void AutofillDataTypeController::OnPersonalDataChanged() { StartDoneImpl(ASSOCIATION_FAILED, NOT_RUNNING, FROM_HERE); } } else { - notification_registrar_.Add(this, NotificationType::WEB_DATABASE_LOADED, + notification_registrar_.Add(this, chrome::NOTIFICATION_WEB_DATABASE_LOADED, NotificationService::AllSources()); } } -void AutofillDataTypeController::Observe(NotificationType type, +void AutofillDataTypeController::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.h b/chrome/browser/sync/glue/autofill_data_type_controller.h index 536ac39..e42ab0d 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.h +++ b/chrome/browser/sync/glue/autofill_data_type_controller.h @@ -16,7 +16,6 @@ #include "content/common/notification_registrar.h" class NotificationDetails; -class NotificationType; class NotificationSource; namespace browser_sync { @@ -35,7 +34,7 @@ class AutofillDataTypeController : public NonFrontendDataTypeController, virtual browser_sync::ModelSafeGroup model_safe_group() const; // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc index a4e854e..51446bb 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc @@ -19,8 +19,8 @@ #include "chrome/browser/webdata/web_data_service.h" #include "chrome/test/profile_mock.h" #include "content/browser/browser_thread.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" #include "testing/gmock/include/gmock/gmock.h" using base::WaitableEvent; diff --git a/chrome/browser/sync/glue/autofill_profile_change_processor.cc b/chrome/browser/sync/glue/autofill_profile_change_processor.cc index ac6099c..8083188 100644 --- a/chrome/browser/sync/glue/autofill_profile_change_processor.cc +++ b/chrome/browser/sync/glue/autofill_profile_change_processor.cc @@ -19,10 +19,10 @@ #include "chrome/browser/sync/unrecoverable_error_handler.h" #include "chrome/browser/webdata/autofill_change.h" #include "chrome/browser/webdata/web_database.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/guid.h" #include "content/common/notification_registrar.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" namespace browser_sync { @@ -92,10 +92,10 @@ void AutofillProfileChangeProcessor::ApplyChangesFromSyncModel( } } -void AutofillProfileChangeProcessor::Observe(NotificationType type, +void AutofillProfileChangeProcessor::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK_EQ(type.value, NotificationType::AUTOFILL_PROFILE_CHANGED); + DCHECK_EQ(type, chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED); WebDataService* wds = Source<WebDataService>(source).ptr(); if (!wds || wds->GetDatabase() != web_database_) @@ -298,7 +298,7 @@ void AutofillProfileChangeProcessor::AddAutofillProfileSyncNode( void AutofillProfileChangeProcessor::StartObserving() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); notification_registrar_.Add(this, - NotificationType::AUTOFILL_PROFILE_CHANGED, + chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED, NotificationService::AllSources()); } diff --git a/chrome/browser/sync/glue/autofill_profile_change_processor.h b/chrome/browser/sync/glue/autofill_profile_change_processor.h index 0a15bc8..c9fd9fe 100644 --- a/chrome/browser/sync/glue/autofill_profile_change_processor.h +++ b/chrome/browser/sync/glue/autofill_profile_change_processor.h @@ -16,10 +16,10 @@ #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" -#include "content/common/notification_type.h" namespace browser_sync { @@ -43,7 +43,7 @@ class AutofillProfileChangeProcessor : public ChangeProcessor, virtual void CommitChangesFromSyncModel(); // Virtual method implemented for the observer class. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.cc b/chrome/browser/sync/glue/bookmark_data_type_controller.cc index 7819468..b7022b2 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller.cc @@ -9,10 +9,10 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/profile_sync_factory.h" #include "chrome/browser/sync/profile_sync_service.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/browser_thread.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" namespace browser_sync { @@ -37,7 +37,7 @@ bool BookmarkDataTypeController::StartModels() { } // Add an observer and continue when the bookmarks model is loaded. - registrar_.Add(this, NotificationType::BOOKMARK_MODEL_LOADED, + registrar_.Add(this, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, Source<Profile>(sync_service_->profile())); return false; // Don't continue Start. } @@ -47,11 +47,11 @@ void BookmarkDataTypeController::CleanUpState() { registrar_.RemoveAll(); } -void BookmarkDataTypeController::Observe(NotificationType type, +void BookmarkDataTypeController::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - DCHECK_EQ(NotificationType::BOOKMARK_MODEL_LOADED, type.value); + DCHECK_EQ(chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, type); registrar_.RemoveAll(); DCHECK_EQ(state_, MODEL_STARTING); state_ = ASSOCIATING; diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.h b/chrome/browser/sync/glue/bookmark_data_type_controller.h index 2655056..b35c93e 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller.h +++ b/chrome/browser/sync/glue/bookmark_data_type_controller.h @@ -13,7 +13,6 @@ #include "content/common/notification_registrar.h" class NotificationDetails; -class NotificationType; class NotificationSource; namespace browser_sync { @@ -32,7 +31,7 @@ class BookmarkDataTypeController : public FrontendDataTypeController, virtual syncable::ModelType type() const; // NotificationObserver interface. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc index af20af5..235c014 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc @@ -15,11 +15,11 @@ #include "chrome/browser/sync/glue/model_associator_mock.h" #include "chrome/browser/sync/profile_sync_factory_mock.h" #include "chrome/browser/sync/profile_sync_service_mock.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/test/profile_mock.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" #include "testing/gmock/include/gmock/gmock.h" using browser_sync::BookmarkDataTypeController; @@ -118,7 +118,7 @@ TEST_F(BookmarkDataTypeControllerTest, StartBookmarkModelNotReady) { // Send the notification that the bookmark model has started. NotificationService::current()->Notify( - NotificationType::BOOKMARK_MODEL_LOADED, + chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, Source<Profile>(&profile_), NotificationService::NoDetails()); EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state()); diff --git a/chrome/browser/sync/glue/data_type_manager_impl.cc b/chrome/browser/sync/glue/data_type_manager_impl.cc index 5626a39..3cbb85f 100644 --- a/chrome/browser/sync/glue/data_type_manager_impl.cc +++ b/chrome/browser/sync/glue/data_type_manager_impl.cc @@ -13,6 +13,7 @@ #include "base/metrics/histogram.h" #include "chrome/browser/sync/glue/data_type_controller.h" #include "chrome/browser/sync/glue/sync_backend_host.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/browser_thread.h" #include "content/common/notification_details.h" #include "content/common/notification_service.h" @@ -377,7 +378,7 @@ void DataTypeManagerImpl::FinishStopAndNotify(ConfigureResult result, void DataTypeManagerImpl::NotifyStart() { NotificationService::current()->Notify( - NotificationType::SYNC_CONFIGURE_START, + chrome::NOTIFICATION_SYNC_CONFIGURE_START, Source<DataTypeManager>(this), NotificationService::NoDetails()); } @@ -415,7 +416,7 @@ void DataTypeManagerImpl::NotifyDone(ConfigureResult result, break; } NotificationService::current()->Notify( - NotificationType::SYNC_CONFIGURE_DONE, + chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, Source<DataTypeManager>(this), Details<ConfigureResultWithErrorLocation>(&result_with_location)); } @@ -434,7 +435,7 @@ void DataTypeManagerImpl::SetBlockedAndNotify() { VLOG(1) << "Accumulated spent configuring: " << configure_time_delta_.InSecondsF() << "s"; NotificationService::current()->Notify( - NotificationType::SYNC_CONFIGURE_BLOCKED, + chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED, Source<DataTypeManager>(this), NotificationService::NoDetails()); } diff --git a/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc b/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc index 1f5e3ef..1a2ba36 100644 --- a/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc +++ b/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc @@ -16,12 +16,12 @@ #include "chrome/browser/sync/glue/sync_backend_host_mock.h" #include "chrome/browser/sync/profile_sync_test_util.h" #include "chrome/browser/sync/syncable/model_type.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/browser_thread.h" #include "content/common/notification_details.h" #include "content/common/notification_observer_mock.h" #include "content/common/notification_registrar.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -73,10 +73,10 @@ class DataTypeManagerImplTest : public testing::Test { protected: virtual void SetUp() { registrar_.Add(&observer_, - NotificationType::SYNC_CONFIGURE_START, + chrome::NOTIFICATION_SYNC_CONFIGURE_START, NotificationService::AllSources()); registrar_.Add(&observer_, - NotificationType::SYNC_CONFIGURE_DONE, + chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, NotificationService::AllSources()); } @@ -145,7 +145,7 @@ class DataTypeManagerImplTest : public testing::Test { void SetConfigureStartExpectation() { EXPECT_CALL( observer_, - Observe(NotificationType(NotificationType::SYNC_CONFIGURE_START), + Observe(int(chrome::NOTIFICATION_SYNC_CONFIGURE_START), _, _)); } @@ -153,7 +153,7 @@ class DataTypeManagerImplTest : public testing::Test { void SetConfigureDoneExpectation(DataTypeManager::ConfigureResult result) { EXPECT_CALL( observer_, - Observe(NotificationType(NotificationType::SYNC_CONFIGURE_DONE), _, + Observe(int(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE), _, ::testing::ResultOf(&GetResult, result))); } diff --git a/chrome/browser/sync/glue/data_type_manager_mock.cc b/chrome/browser/sync/glue/data_type_manager_mock.cc index 1f75b84..2a21712 100644 --- a/chrome/browser/sync/glue/data_type_manager_mock.cc +++ b/chrome/browser/sync/glue/data_type_manager_mock.cc @@ -4,6 +4,7 @@ #include "base/tracked.h" #include "chrome/browser/sync/glue/data_type_manager_mock.h" +#include "chrome/common/chrome_notification_types.h" namespace browser_sync { @@ -16,9 +17,9 @@ DataTypeManagerMock::DataTypeManagerMock() ON_CALL(*this, Configure(testing::_, testing::_)). WillByDefault(testing::DoAll( NotifyFromDataTypeManager(this, - NotificationType::SYNC_CONFIGURE_START), + chrome::NOTIFICATION_SYNC_CONFIGURE_START), NotifyFromDataTypeManagerWithResult - (this, NotificationType::SYNC_CONFIGURE_DONE, &result_))); + (this, chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, &result_))); // By default, calling ConfigureWithoutNigori will send a SYNC_CONFIGURE_START // and SYNC_CONFIGURE_DONE notification with a DataTypeManager::OK @@ -26,9 +27,9 @@ DataTypeManagerMock::DataTypeManagerMock() ON_CALL(*this, ConfigureWithoutNigori(testing::_, testing::_)). WillByDefault(testing::DoAll( NotifyFromDataTypeManager(this, - NotificationType::SYNC_CONFIGURE_START), + chrome::NOTIFICATION_SYNC_CONFIGURE_START), NotifyFromDataTypeManagerWithResult - (this, NotificationType::SYNC_CONFIGURE_DONE, &result_))); + (this, chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, &result_))); } DataTypeManagerMock::~DataTypeManagerMock() {} diff --git a/chrome/browser/sync/glue/data_type_manager_mock.h b/chrome/browser/sync/glue/data_type_manager_mock.h index 0645164..be45d9f 100644 --- a/chrome/browser/sync/glue/data_type_manager_mock.h +++ b/chrome/browser/sync/glue/data_type_manager_mock.h @@ -8,9 +8,9 @@ #include "chrome/browser/sync/glue/data_type_manager.h" #include "chrome/browser/sync/profile_sync_test_util.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_details.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "testing/gmock/include/gmock/gmock.h" ACTION_P3(NotifyFromDataTypeManagerWithResult, dtm, type, result) { diff --git a/chrome/browser/sync/glue/extension_change_processor.cc b/chrome/browser/sync/glue/extension_change_processor.cc index 736f34a..9d6ed26 100644 --- a/chrome/browser/sync/glue/extension_change_processor.cc +++ b/chrome/browser/sync/glue/extension_change_processor.cc @@ -14,6 +14,7 @@ #include "chrome/browser/sync/glue/extension_sync.h" #include "chrome/browser/sync/glue/extension_util.h" #include "chrome/browser/sync/protocol/extension_specifics.pb.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "content/browser/browser_thread.h" #include "content/common/notification_details.h" @@ -39,24 +40,24 @@ ExtensionChangeProcessor::~ExtensionChangeProcessor() { // the browser or the syncapi are done in order; this is tricky since // some events (e.g., extension installation) are done asynchronously. -void ExtensionChangeProcessor::Observe(NotificationType type, +void ExtensionChangeProcessor::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(running()); DCHECK(profile_); - if ((type != NotificationType::EXTENSION_LOADED) && - (type != NotificationType::EXTENSION_UPDATE_DISABLED) && - (type != NotificationType::EXTENSION_UNLOADED)) { + if ((type != chrome::NOTIFICATION_EXTENSION_LOADED) && + (type != chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED) && + (type != chrome::NOTIFICATION_EXTENSION_UNLOADED)) { LOG(DFATAL) << "Received unexpected notification of type " - << type.value; + << type; return; } // Filter out unhandled extensions first. DCHECK_EQ(Source<Profile>(source).ptr(), profile_); const Extension& extension = - (type == NotificationType::EXTENSION_UNLOADED) ? + (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) ? *Details<UnloadedExtensionInfo>(details)->extension : *Details<const Extension>(details).ptr(); if (!traits_.is_valid_and_syncable(extension)) { @@ -66,7 +67,7 @@ void ExtensionChangeProcessor::Observe(NotificationType type, const std::string& id = extension.id(); // Then handle extension uninstalls. - if (type == NotificationType::EXTENSION_UNLOADED) { + if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) { const UnloadedExtensionInfo& info = *Details<UnloadedExtensionInfo>(details).ptr(); if (info.reason == UnloadedExtensionInfo::UNINSTALL) { @@ -78,7 +79,7 @@ void ExtensionChangeProcessor::Observe(NotificationType type, } VLOG(1) << "Updating server data for extension " << id - << " (notification type = " << type.value << ")"; + << " (notification type = " << type << ")"; std::string error; if (!UpdateServerData(traits_, extension, *extension_service_, share_handle(), &error)) { @@ -163,16 +164,16 @@ void ExtensionChangeProcessor::StartObserving() { DCHECK(profile_); notification_registrar_.Add( - this, NotificationType::EXTENSION_LOADED, + this, chrome::NOTIFICATION_EXTENSION_LOADED, Source<Profile>(profile_)); // Despite the name, this notification is exactly like // EXTENSION_LOADED but with an initial state of DISABLED. notification_registrar_.Add( - this, NotificationType::EXTENSION_UPDATE_DISABLED, + this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, Source<Profile>(profile_)); notification_registrar_.Add( - this, NotificationType::EXTENSION_UNLOADED, + this, chrome::NOTIFICATION_EXTENSION_UNLOADED, Source<Profile>(profile_)); } diff --git a/chrome/browser/sync/glue/extension_change_processor.h b/chrome/browser/sync/glue/extension_change_processor.h index 7f1d916..f2493be 100644 --- a/chrome/browser/sync/glue/extension_change_processor.h +++ b/chrome/browser/sync/glue/extension_change_processor.h @@ -10,9 +10,9 @@ #include "chrome/browser/sync/engine/syncapi.h" #include "chrome/browser/sync/glue/change_processor.h" #include "chrome/browser/sync/glue/extension_sync_traits.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" -#include "content/common/notification_type.h" class ExtensionServiceInterface; @@ -33,7 +33,7 @@ class ExtensionChangeProcessor : public ChangeProcessor, // NotificationObserver implementation. // BrowserExtensionProvider -> sync_api model change application. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/sync/glue/password_change_processor.cc b/chrome/browser/sync/glue/password_change_processor.cc index 67d9187..d2f4d13 100644 --- a/chrome/browser/sync/glue/password_change_processor.cc +++ b/chrome/browser/sync/glue/password_change_processor.cc @@ -15,9 +15,10 @@ #include "chrome/browser/sync/glue/password_model_associator.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/protocol/password_specifics.pb.h" +#include "chrome/common/chrome_notification_types.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" #include "webkit/glue/password_form.h" namespace browser_sync { @@ -45,11 +46,11 @@ PasswordChangeProcessor::~PasswordChangeProcessor() { DCHECK(expected_loop_ == MessageLoop::current()); } -void PasswordChangeProcessor::Observe(NotificationType type, +void PasswordChangeProcessor::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(expected_loop_ == MessageLoop::current()); - DCHECK(NotificationType::LOGINS_CHANGED == type); + DCHECK(chrome::NOTIFICATION_LOGINS_CHANGED == type); if (!observing_) return; @@ -222,14 +223,14 @@ void PasswordChangeProcessor::StopImpl() { void PasswordChangeProcessor::StartObserving() { DCHECK(expected_loop_ == MessageLoop::current()); notification_registrar_.Add(this, - NotificationType::LOGINS_CHANGED, + chrome::NOTIFICATION_LOGINS_CHANGED, Source<PasswordStore>(password_store_)); } void PasswordChangeProcessor::StopObserving() { DCHECK(expected_loop_ == MessageLoop::current()); notification_registrar_.Remove(this, - NotificationType::LOGINS_CHANGED, + chrome::NOTIFICATION_LOGINS_CHANGED, Source<PasswordStore>(password_store_)); } diff --git a/chrome/browser/sync/glue/password_change_processor.h b/chrome/browser/sync/glue/password_change_processor.h index 155a1b3..fdfd009 100644 --- a/chrome/browser/sync/glue/password_change_processor.h +++ b/chrome/browser/sync/glue/password_change_processor.h @@ -12,9 +12,9 @@ #include "base/compiler_specific.h" #include "chrome/browser/sync/glue/password_model_associator.h" #include "chrome/browser/sync/glue/sync_backend_host.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" -#include "content/common/notification_type.h" class PasswordStore; class MessageLoop; @@ -38,7 +38,7 @@ class PasswordChangeProcessor : public ChangeProcessor, // NotificationObserver implementation. // Passwords -> sync_api model change application. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) OVERRIDE; diff --git a/chrome/browser/sync/glue/session_change_processor.cc b/chrome/browser/sync/glue/session_change_processor.cc index 2b33c7b..b2d0bd4 100644 --- a/chrome/browser/sync/glue/session_change_processor.cc +++ b/chrome/browser/sync/glue/session_change_processor.cc @@ -16,6 +16,7 @@ #include "chrome/browser/sync/glue/session_model_associator.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/tab_contents/navigation_controller.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_details.h" @@ -53,7 +54,7 @@ SessionChangeProcessor::~SessionChangeProcessor() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); } -void SessionChangeProcessor::Observe(NotificationType type, +void SessionChangeProcessor::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -63,8 +64,8 @@ void SessionChangeProcessor::Observe(NotificationType type, // Track which windows and/or tabs are modified. std::vector<TabContentsWrapper*> modified_tabs; bool windows_changed = false; - switch (type.value) { - case NotificationType::BROWSER_OPENED: { + switch (type) { + case chrome::NOTIFICATION_BROWSER_OPENED: { Browser* browser = Source<Browser>(source).ptr(); if (browser->profile() != profile_) { return; @@ -74,7 +75,7 @@ void SessionChangeProcessor::Observe(NotificationType type, break; } - case NotificationType::TAB_PARENTED: { + case content::NOTIFICATION_TAB_PARENTED: { TabContentsWrapper* tab = Source<TabContentsWrapper>(source).ptr(); if (tab->profile() != profile_) { return; @@ -84,7 +85,7 @@ void SessionChangeProcessor::Observe(NotificationType type, break; } - case NotificationType::TAB_CLOSED: { + case content::NOTIFICATION_TAB_CLOSED: { TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( Source<NavigationController>(source).ptr()->tab_contents()); @@ -96,7 +97,7 @@ void SessionChangeProcessor::Observe(NotificationType type, break; } - case NotificationType::NAV_LIST_PRUNED: { + case content::NOTIFICATION_NAV_LIST_PRUNED: { TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( Source<NavigationController>(source).ptr()->tab_contents()); @@ -107,7 +108,7 @@ void SessionChangeProcessor::Observe(NotificationType type, break; } - case NotificationType::NAV_ENTRY_CHANGED: { + case content::NOTIFICATION_NAV_ENTRY_CHANGED: { TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( Source<NavigationController>(source).ptr()->tab_contents()); @@ -118,7 +119,7 @@ void SessionChangeProcessor::Observe(NotificationType type, break; } - case NotificationType::NAV_ENTRY_COMMITTED: { + case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( Source<NavigationController>(source).ptr()->tab_contents()); @@ -129,7 +130,7 @@ void SessionChangeProcessor::Observe(NotificationType type, break; } - case NotificationType::TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED: { + case chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED: { ExtensionTabHelper* extension_tab_helper = Source<ExtensionTabHelper>(source).ptr(); if (extension_tab_helper->tab_contents()->profile() != profile_) { @@ -142,7 +143,7 @@ void SessionChangeProcessor::Observe(NotificationType type, } default: LOG(ERROR) << "Received unexpected notification of type " - << type.value; + << type; break; } @@ -220,7 +221,7 @@ void SessionChangeProcessor::ApplyChangesFromSyncModel( // Notify foreign session handlers that there are new sessions. NotificationService::current()->Notify( - NotificationType::FOREIGN_SESSION_UPDATED, + chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED, NotificationService::AllSources(), NotificationService::NoDetails()); @@ -244,20 +245,20 @@ void SessionChangeProcessor::StopImpl() { void SessionChangeProcessor::StartObserving() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(profile_); - notification_registrar_.Add(this, NotificationType::TAB_PARENTED, + notification_registrar_.Add(this, content::NOTIFICATION_TAB_PARENTED, NotificationService::AllSources()); - notification_registrar_.Add(this, NotificationType::TAB_CLOSED, + notification_registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED, NotificationService::AllSources()); - notification_registrar_.Add(this, NotificationType::NAV_LIST_PRUNED, + notification_registrar_.Add(this, content::NOTIFICATION_NAV_LIST_PRUNED, NotificationService::AllSources()); - notification_registrar_.Add(this, NotificationType::NAV_ENTRY_CHANGED, + notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_CHANGED, NotificationService::AllSources()); - notification_registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED, + notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, NotificationService::AllSources()); - notification_registrar_.Add(this, NotificationType::BROWSER_OPENED, + notification_registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED, NotificationService::AllSources()); notification_registrar_.Add(this, - NotificationType::TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, + chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, NotificationService::AllSources()); } diff --git a/chrome/browser/sync/glue/session_change_processor.h b/chrome/browser/sync/glue/session_change_processor.h index 6213443..62fa5c8 100644 --- a/chrome/browser/sync/glue/session_change_processor.h +++ b/chrome/browser/sync/glue/session_change_processor.h @@ -11,9 +11,9 @@ #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sync/engine/syncapi.h" #include "chrome/browser/sync/glue/change_processor.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" -#include "content/common/notification_type.h" class NotificationDetails; class NotificationSource; @@ -43,7 +43,7 @@ class SessionChangeProcessor : public ChangeProcessor, // NotificationObserver implementation. // BrowserSessionProvider -> sync_api model change application. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc index 7d4eeb0..17126a5 100644 --- a/chrome/browser/sync/glue/session_model_associator.cc +++ b/chrome/browser/sync/glue/session_model_associator.cc @@ -19,6 +19,7 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/url_constants.h" #include "content/browser/tab_contents/navigation_controller.h" @@ -426,7 +427,7 @@ bool SessionModelAssociator::DisassociateModels() { // There is no local model stored with which to disassociate, just notify // foreign session handlers. NotificationService::current()->Notify( - NotificationType::FOREIGN_SESSION_DISABLED, + chrome::NOTIFICATION_FOREIGN_SESSION_DISABLED, NotificationService::AllSources(), NotificationService::NoDetails()); return true; diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc index 4c860dc..1074328 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -33,13 +33,13 @@ #include "chrome/browser/sync/syncable/directory_manager.h" // Cryptographer. #include "chrome/browser/sync/syncable/model_type.h" #include "chrome/browser/sync/syncable/nigori_util.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/net/gaia/gaia_constants.h" #include "chrome/common/pref_names.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "googleurl/src/gurl.h" #include "webkit/glue/webkit_glue.h" @@ -537,7 +537,7 @@ void SyncBackendHost::Core::NotifyUpdatedToken(const std::string& token) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); TokenAvailableDetails details(GaiaConstants::kSyncService, token); NotificationService::current()->Notify( - NotificationType::TOKEN_UPDATED, + chrome::NOTIFICATION_TOKEN_UPDATED, NotificationService::AllSources(), Details<const TokenAvailableDetails>(&details)); } diff --git a/chrome/browser/sync/glue/sync_backend_host_mock.h b/chrome/browser/sync/glue/sync_backend_host_mock.h index 882265c..ad063e0 100644 --- a/chrome/browser/sync/glue/sync_backend_host_mock.h +++ b/chrome/browser/sync/glue/sync_backend_host_mock.h @@ -11,7 +11,7 @@ #include "base/task.h" #include "chrome/browser/sync/glue/sync_backend_host.h" #include "chrome/browser/sync/profile_sync_test_util.h" -#include "content/common/notification_type.h" +#include "content/common/content_notification_types.h" #include "testing/gmock/include/gmock/gmock.h" namespace browser_sync { diff --git a/chrome/browser/sync/glue/theme_change_processor.cc b/chrome/browser/sync/glue/theme_change_processor.cc index ace9931..8ffd402 100644 --- a/chrome/browser/sync/glue/theme_change_processor.cc +++ b/chrome/browser/sync/glue/theme_change_processor.cc @@ -12,6 +12,7 @@ #include "chrome/browser/sync/protocol/theme_specifics.pb.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" @@ -27,12 +28,12 @@ ThemeChangeProcessor::ThemeChangeProcessor( ThemeChangeProcessor::~ThemeChangeProcessor() {} -void ThemeChangeProcessor::Observe(NotificationType type, +void ThemeChangeProcessor::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(running()); DCHECK(profile_); - DCHECK(type == NotificationType::BROWSER_THEME_CHANGED); + DCHECK(type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED); sync_api::WriteTransaction trans(FROM_HERE, share_handle()); sync_api::WriteNode node(&trans); @@ -121,7 +122,7 @@ void ThemeChangeProcessor::StartObserving() { DCHECK(profile_); VLOG(1) << "Observing BROWSER_THEME_CHANGED"; notification_registrar_.Add( - this, NotificationType::BROWSER_THEME_CHANGED, + this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, Source<ThemeService>( ThemeServiceFactory::GetForProfile(profile_))); } diff --git a/chrome/browser/sync/glue/theme_change_processor.h b/chrome/browser/sync/glue/theme_change_processor.h index 7a94c92..72c7473 100644 --- a/chrome/browser/sync/glue/theme_change_processor.h +++ b/chrome/browser/sync/glue/theme_change_processor.h @@ -9,9 +9,9 @@ #include "base/basictypes.h" #include "chrome/browser/sync/engine/syncapi.h" #include "chrome/browser/sync/glue/change_processor.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" -#include "content/common/notification_type.h" class NotificationDetails; class NotificationSource; @@ -33,7 +33,7 @@ class ThemeChangeProcessor : public ChangeProcessor, // NotificationObserver implementation. // ThemeService -> sync_api model change application. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc index 2b79fd0..2c10771 100644 --- a/chrome/browser/sync/glue/typed_url_change_processor.cc +++ b/chrome/browser/sync/glue/typed_url_change_processor.cc @@ -13,8 +13,8 @@ #include "chrome/browser/sync/glue/typed_url_model_associator.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/protocol/typed_url_specifics.pb.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" namespace browser_sync { @@ -50,7 +50,7 @@ TypedUrlChangeProcessor::~TypedUrlChangeProcessor() { DCHECK(expected_loop_ == MessageLoop::current()); } -void TypedUrlChangeProcessor::Observe(NotificationType type, +void TypedUrlChangeProcessor::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(expected_loop_ == MessageLoop::current()); @@ -59,14 +59,14 @@ void TypedUrlChangeProcessor::Observe(NotificationType type, VLOG(1) << "Observed typed_url change."; DCHECK(running()); - DCHECK(NotificationType::HISTORY_TYPED_URLS_MODIFIED == type || - NotificationType::HISTORY_URLS_DELETED == type || - NotificationType::HISTORY_URL_VISITED == type); - if (type == NotificationType::HISTORY_TYPED_URLS_MODIFIED) { + DCHECK(chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED == type || + chrome::NOTIFICATION_HISTORY_URLS_DELETED == type || + chrome::NOTIFICATION_HISTORY_URL_VISITED == type); + if (type == chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED) { HandleURLsModified(Details<history::URLsModifiedDetails>(details).ptr()); - } else if (type == NotificationType::HISTORY_URLS_DELETED) { + } else if (type == chrome::NOTIFICATION_HISTORY_URLS_DELETED) { HandleURLsDeleted(Details<history::URLsDeletedDetails>(details).ptr()); - } else if (type == NotificationType::HISTORY_URL_VISITED) { + } else if (type == chrome::NOTIFICATION_HISTORY_URL_VISITED) { HandleURLsVisited(Details<history::URLVisitedDetails>(details).ptr()); } } @@ -347,24 +347,24 @@ void TypedUrlChangeProcessor::StopImpl() { void TypedUrlChangeProcessor::StartObserving() { DCHECK(expected_loop_ == MessageLoop::current()); notification_registrar_.Add(this, - NotificationType::HISTORY_TYPED_URLS_MODIFIED, + chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED, NotificationService::AllSources()); - notification_registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED, + notification_registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, NotificationService::AllSources()); - notification_registrar_.Add(this, NotificationType::HISTORY_URL_VISITED, + notification_registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URL_VISITED, NotificationService::AllSources()); } void TypedUrlChangeProcessor::StopObserving() { DCHECK(expected_loop_ == MessageLoop::current()); + notification_registrar_.Remove( + this, chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED, + NotificationService::AllSources()); notification_registrar_.Remove(this, - NotificationType::HISTORY_TYPED_URLS_MODIFIED, + chrome::NOTIFICATION_HISTORY_URLS_DELETED, NotificationService::AllSources()); notification_registrar_.Remove(this, - NotificationType::HISTORY_URLS_DELETED, - NotificationService::AllSources()); - notification_registrar_.Remove(this, - NotificationType::HISTORY_URL_VISITED, + chrome::NOTIFICATION_HISTORY_URL_VISITED, NotificationService::AllSources()); } diff --git a/chrome/browser/sync/glue/typed_url_change_processor.h b/chrome/browser/sync/glue/typed_url_change_processor.h index a2153f6..cc62a48 100644 --- a/chrome/browser/sync/glue/typed_url_change_processor.h +++ b/chrome/browser/sync/glue/typed_url_change_processor.h @@ -13,9 +13,9 @@ #include "base/time.h" #include "chrome/browser/sync/glue/sync_backend_host.h" #include "chrome/browser/sync/glue/typed_url_model_associator.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" -#include "content/common/notification_type.h" class MessageLoop; class NotificationService; @@ -45,7 +45,7 @@ class TypedUrlChangeProcessor : public ChangeProcessor, // NotificationObserver implementation. // History -> sync_api model change application. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.cc b/chrome/browser/sync/glue/typed_url_data_type_controller.cc index ee5e249..9e4bd71 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.cc +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.cc @@ -10,6 +10,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/profile_sync_factory.h" #include "chrome/browser/sync/profile_sync_service.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" @@ -71,7 +72,7 @@ bool TypedUrlDataTypeController::StartModels() { history_service_ = history; return true; } else { - notification_registrar_.Add(this, NotificationType::HISTORY_LOADED, + notification_registrar_.Add(this, chrome::NOTIFICATION_HISTORY_LOADED, NotificationService::AllSources()); return false; } @@ -99,13 +100,13 @@ void TypedUrlDataTypeController::CreateSyncComponents() { set_change_processor(sync_components.change_processor); } -void TypedUrlDataTypeController::Observe(NotificationType type, +void TypedUrlDataTypeController::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_EQ(state(), MODEL_STARTING); notification_registrar_.Remove(this, - NotificationType::HISTORY_LOADED, + chrome::NOTIFICATION_HISTORY_LOADED, NotificationService::AllSources()); history_service_ = profile()->GetHistoryServiceWithoutCreating(); DCHECK(history_service_.get()); diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.h b/chrome/browser/sync/glue/typed_url_data_type_controller.h index 18f0a04..9720614 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.h +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.h @@ -11,9 +11,9 @@ #include "base/memory/scoped_ptr.h" #include "chrome/browser/sync/glue/non_frontend_data_type_controller.h" #include "content/browser/cancelable_request.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" -#include "content/common/notification_type.h" class NotificationSource; class NotificationDetails; @@ -41,7 +41,7 @@ class TypedUrlDataTypeController : public NonFrontendDataTypeController, virtual browser_sync::ModelSafeGroup model_safe_group() const; // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); |