diff options
Diffstat (limited to 'chrome/browser/sync/glue')
28 files changed, 177 insertions, 177 deletions
diff --git a/chrome/browser/sync/glue/autofill_change_processor.cc b/chrome/browser/sync/glue/autofill_change_processor.cc index 4f18dcb..ce1b0d9 100644 --- a/chrome/browser/sync/glue/autofill_change_processor.cc +++ b/chrome/browser/sync/glue/autofill_change_processor.cc @@ -59,11 +59,12 @@ AutofillChangeProcessor::AutofillChangeProcessor( AutofillChangeProcessor::~AutofillChangeProcessor() {} -void AutofillChangeProcessor::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { +void AutofillChangeProcessor::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { // Ensure this notification came from our web database. - WebDataService* wds = Source<WebDataService>(source).ptr(); + WebDataService* wds = content::Source<WebDataService>(source).ptr(); if (!wds || wds->GetDatabase() != web_database_) return; @@ -83,7 +84,8 @@ void AutofillChangeProcessor::Observe(int type, DCHECK(type == chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED); - AutofillChangeList* changes = Details<AutofillChangeList>(details).ptr(); + AutofillChangeList* changes = + content::Details<AutofillChangeList>(details).ptr(); ObserveAutofillEntriesChanged(changes, &trans, autofill_root); } diff --git a/chrome/browser/sync/glue/autofill_change_processor.h b/chrome/browser/sync/glue/autofill_change_processor.h index 454c11f..f29bac2 100644 --- a/chrome/browser/sync/glue/autofill_change_processor.h +++ b/chrome/browser/sync/glue/autofill_change_processor.h @@ -13,8 +13,8 @@ #include "chrome/browser/sync/glue/sync_backend_host.h" #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" #include "chrome/browser/webdata/web_data_service.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" class AutofillEntry; class AutofillProfileChange; @@ -35,7 +35,7 @@ class UnrecoverableErrorHandler; // applying them to the sync_api 'syncable' model, and vice versa. All // operations and use of this class are from the DB thread. class AutofillChangeProcessor : public ChangeProcessor, - public NotificationObserver { + public content::NotificationObserver { public: AutofillChangeProcessor(AutofillModelAssociator* model_associator, WebDatabase* web_database, @@ -43,11 +43,11 @@ class AutofillChangeProcessor : public ChangeProcessor, UnrecoverableErrorHandler* error_handler); virtual ~AutofillChangeProcessor(); - // NotificationObserver implementation. + // content::NotificationObserver implementation. // WebDataService -> sync_api model change application. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) OVERRIDE; + const content::NotificationSource& source, + const content::NotificationDetails& details) OVERRIDE; // sync_api model -> WebDataService change application. virtual void ApplyChangesFromSyncModel( @@ -118,7 +118,7 @@ class AutofillChangeProcessor : public ChangeProcessor, // the changes made. Profile* profile_; - NotificationRegistrar notification_registrar_; + content::NotificationRegistrar notification_registrar_; bool observing_; diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.cc b/chrome/browser/sync/glue/autofill_data_type_controller.cc index 9d258a6..74f9f32 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller.cc @@ -16,7 +16,7 @@ #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/public/browser/notification_source.h" namespace browser_sync { @@ -49,7 +49,7 @@ bool AutofillDataTypeController::StartModels() { } else { notification_registrar_.Add( this, chrome::NOTIFICATION_WEB_DATABASE_LOADED, - Source<WebDataService>(web_data_service_.get())); + content::Source<WebDataService>(web_data_service_.get())); return false; } } @@ -70,13 +70,14 @@ void AutofillDataTypeController::OnPersonalDataChanged() { } else { notification_registrar_.Add( this, chrome::NOTIFICATION_WEB_DATABASE_LOADED, - Source<WebDataService>(web_data_service_.get())); + content::Source<WebDataService>(web_data_service_.get())); } } -void AutofillDataTypeController::Observe(int notification_type, - const NotificationSource& source, - const NotificationDetails& details) { +void AutofillDataTypeController::Observe( + int notification_type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_EQ(state(), MODEL_STARTING); notification_registrar_.RemoveAll(); diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.h b/chrome/browser/sync/glue/autofill_data_type_controller.h index f5a1118..b5aa65f 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.h +++ b/chrome/browser/sync/glue/autofill_data_type_controller.h @@ -12,11 +12,9 @@ #include "base/memory/ref_counted.h" #include "chrome/browser/autofill/personal_data_manager_observer.h" #include "chrome/browser/sync/glue/non_frontend_data_type_controller.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" -class NotificationDetails; -class NotificationSource; class PersonalDataManager; class WebDataService; @@ -24,7 +22,7 @@ namespace browser_sync { // A class that manages the startup and shutdown of autofill sync. class AutofillDataTypeController : public NonFrontendDataTypeController, - public NotificationObserver, + public content::NotificationObserver, public PersonalDataManagerObserver { public: AutofillDataTypeController(ProfileSyncFactory* profile_sync_factory, @@ -35,10 +33,10 @@ class AutofillDataTypeController : public NonFrontendDataTypeController, virtual syncable::ModelType type() const; virtual browser_sync::ModelSafeGroup model_safe_group() const; - // NotificationObserver implementation. + // content::NotificationObserver implementation. virtual void Observe(int notification_type, - const NotificationSource& source, - const NotificationDetails& details); + const content::NotificationSource& source, + const content::NotificationDetails& details); // PersonalDataManagerObserver implementation: virtual void OnPersonalDataChanged() OVERRIDE; @@ -63,7 +61,7 @@ class AutofillDataTypeController : public NonFrontendDataTypeController, private: PersonalDataManager* personal_data_; scoped_refptr<WebDataService> web_data_service_; - NotificationRegistrar notification_registrar_; + content::NotificationRegistrar notification_registrar_; DISALLOW_COPY_AND_ASSIGN(AutofillDataTypeController); }; 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 012f8d9..e954f65 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc @@ -21,7 +21,7 @@ #include "chrome/browser/webdata/web_data_service.h" #include "chrome/test/base/profile_mock.h" #include "content/browser/browser_thread.h" -#include "content/common/notification_source.h" +#include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" #include "testing/gmock/include/gmock/gmock.h" 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 9edf21b..152a4a2 100644 --- a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc +++ b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc @@ -17,7 +17,7 @@ #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/public/browser/notification_source.h" namespace browser_sync { @@ -67,8 +67,8 @@ void AutofillProfileDataTypeController::OnPersonalDataChanged() { void AutofillProfileDataTypeController::Observe( int notification_type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { notification_registrar_.RemoveAll(); DoStartAssociationAsync(); } diff --git a/chrome/browser/sync/glue/autofill_profile_data_type_controller.h b/chrome/browser/sync/glue/autofill_profile_data_type_controller.h index f55dd8a..3613355 100644 --- a/chrome/browser/sync/glue/autofill_profile_data_type_controller.h +++ b/chrome/browser/sync/glue/autofill_profile_data_type_controller.h @@ -10,11 +10,9 @@ #include "base/memory/ref_counted.h" #include "chrome/browser/autofill/personal_data_manager_observer.h" #include "chrome/browser/sync/glue/new_non_frontend_data_type_controller.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" -class NotificationDetails; -class NotificationSource; class PersonalDataManager; class WebDataService; @@ -22,7 +20,7 @@ namespace browser_sync { class AutofillProfileDataTypeController : public NewNonFrontendDataTypeController, - public NotificationObserver, + public content::NotificationObserver, public PersonalDataManagerObserver { public: AutofillProfileDataTypeController( @@ -34,10 +32,10 @@ class AutofillProfileDataTypeController virtual syncable::ModelType type() const OVERRIDE; virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE; - // NotificationObserver implementation. + // content::NotificationObserver implementation. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) OVERRIDE; + const content::NotificationSource& source, + const content::NotificationDetails& details) OVERRIDE; // PersonalDataManagerObserver implementation: virtual void OnPersonalDataChanged() OVERRIDE; @@ -61,7 +59,7 @@ class AutofillProfileDataTypeController private: PersonalDataManager* personal_data_; scoped_refptr<WebDataService> web_data_service_; - NotificationRegistrar notification_registrar_; + content::NotificationRegistrar notification_registrar_; DISALLOW_COPY_AND_ASSIGN(AutofillProfileDataTypeController); }; diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.cc b/chrome/browser/sync/glue/bookmark_data_type_controller.cc index b7022b2..b2f1057 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller.cc @@ -11,8 +11,8 @@ #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/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" namespace browser_sync { @@ -38,7 +38,7 @@ bool BookmarkDataTypeController::StartModels() { // Add an observer and continue when the bookmarks model is loaded. registrar_.Add(this, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, - Source<Profile>(sync_service_->profile())); + content::Source<Profile>(sync_service_->profile())); return false; // Don't continue Start. } @@ -47,9 +47,10 @@ void BookmarkDataTypeController::CleanUpState() { registrar_.RemoveAll(); } -void BookmarkDataTypeController::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { +void BookmarkDataTypeController::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_EQ(chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, type); registrar_.RemoveAll(); diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.h b/chrome/browser/sync/glue/bookmark_data_type_controller.h index b35c93e..56366d1 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller.h +++ b/chrome/browser/sync/glue/bookmark_data_type_controller.h @@ -9,17 +9,14 @@ #include <string> #include "chrome/browser/sync/glue/frontend_data_type_controller.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" - -class NotificationDetails; -class NotificationSource; +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" namespace browser_sync { // A class that manages the startup and shutdown of bookmark sync. class BookmarkDataTypeController : public FrontendDataTypeController, - public NotificationObserver { + public content::NotificationObserver { public: BookmarkDataTypeController( ProfileSyncFactory* profile_sync_factory, @@ -30,10 +27,10 @@ class BookmarkDataTypeController : public FrontendDataTypeController, // FrontendDataTypeController interface. virtual syncable::ModelType type() const; - // NotificationObserver interface. + // content::NotificationObserver interface. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details); + const content::NotificationSource& source, + const content::NotificationDetails& details); private: // FrontendDataTypeController interface. @@ -46,7 +43,7 @@ class BookmarkDataTypeController : public FrontendDataTypeController, virtual void RecordAssociationTime(base::TimeDelta time); virtual void RecordStartFailure(StartResult result); - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; DISALLOW_COPY_AND_ASSIGN(BookmarkDataTypeController); }; 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 6f65b9f..d8a3fa9 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc @@ -20,7 +20,7 @@ #include "chrome/test/base/profile_mock.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" -#include "content/common/notification_source.h" +#include "content/public/browser/notification_source.h" #include "testing/gmock/include/gmock/gmock.h" using browser_sync::BookmarkDataTypeController; @@ -115,7 +115,7 @@ TEST_F(BookmarkDataTypeControllerTest, StartBookmarkModelNotReady) { // Send the notification that the bookmark model has started. NotificationService::current()->Notify( chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, - Source<Profile>(&profile_), + content::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 d2f5728..3a58290 100644 --- a/chrome/browser/sync/glue/data_type_manager_impl.cc +++ b/chrome/browser/sync/glue/data_type_manager_impl.cc @@ -18,9 +18,9 @@ #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" -#include "content/common/notification_source.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" namespace browser_sync { @@ -459,7 +459,7 @@ void DataTypeManagerImpl::Abort(ConfigureStatus status, void DataTypeManagerImpl::NotifyStart() { NotificationService::current()->Notify( chrome::NOTIFICATION_SYNC_CONFIGURE_START, - Source<DataTypeManager>(this), + content::Source<DataTypeManager>(this), NotificationService::NoDetails()); } @@ -495,8 +495,8 @@ void DataTypeManagerImpl::NotifyDone(const ConfigureResult& result) { } NotificationService::current()->Notify( chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, - Source<DataTypeManager>(this), - Details<const ConfigureResult>(&result)); + content::Source<DataTypeManager>(this), + content::Details<const ConfigureResult>(&result)); } DataTypeManager::State DataTypeManagerImpl::state() { @@ -510,7 +510,7 @@ void DataTypeManagerImpl::SetBlockedAndNotify() { << configure_time_delta_.InSecondsF() << "s"; NotificationService::current()->Notify( chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED, - Source<DataTypeManager>(this), + content::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 8714278..eccd6f8 100644 --- a/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc +++ b/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc @@ -18,10 +18,10 @@ #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/public/browser/notification_registrar.h" #include "content/common/notification_service.h" +#include "content/public/browser/notification_details.h" +#include "content/test/notification_observer_mock.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -46,9 +46,9 @@ using testing::Return; using testing::SaveArg; DataTypeManager::ConfigureStatus GetStatus( - const NotificationDetails& details) { + const content::NotificationDetails& details) { const DataTypeManager::ConfigureResult* result = - Details<const DataTypeManager::ConfigureResult>( + content::Details<const DataTypeManager::ConfigureResult>( details).ptr(); return result->status; } @@ -285,8 +285,8 @@ class DataTypeManagerImplTest : public testing::Test { BrowserThread ui_thread_; DataTypeController::TypeMap controllers_; NiceMock<SyncBackendHostMock> backend_; - NotificationObserverMock observer_; - NotificationRegistrar registrar_; + content::NotificationObserverMock observer_; + content::NotificationRegistrar registrar_; std::set<syncable::ModelType> types_; }; diff --git a/chrome/browser/sync/glue/data_type_manager_mock.h b/chrome/browser/sync/glue/data_type_manager_mock.h index d152f1b..34828d8 100644 --- a/chrome/browser/sync/glue/data_type_manager_mock.h +++ b/chrome/browser/sync/glue/data_type_manager_mock.h @@ -9,8 +9,8 @@ #include "chrome/browser/sync/api/sync_error.h" #include "chrome/browser/sync/glue/data_type_manager.h" #include "chrome/browser/sync/profile_sync_test_util.h" -#include "content/common/notification_details.h" #include "content/common/notification_service.h" +#include "content/public/browser/notification_details.h" #include "content/public/browser/notification_types.h" #include "testing/gmock/include/gmock/gmock.h" @@ -37,14 +37,14 @@ ACTION_P3(InvokeCallbackPointer, callback, datatype, callback_result) { ACTION_P3(NotifyFromDataTypeManagerWithResult, dtm, type, result) { NotificationService::current()->Notify( type, - Source<browser_sync::DataTypeManager>(dtm), - Details<const browser_sync::DataTypeManager::ConfigureResult>( + content::Source<browser_sync::DataTypeManager>(dtm), + content::Details<const browser_sync::DataTypeManager::ConfigureResult>( result)); } ACTION_P2(NotifyFromDataTypeManager, dtm, type) { NotificationService::current()->Notify(type, - Source<browser_sync::DataTypeManager>(dtm), + content::Source<browser_sync::DataTypeManager>(dtm), NotificationService::NoDetails()); } diff --git a/chrome/browser/sync/glue/password_change_processor.cc b/chrome/browser/sync/glue/password_change_processor.cc index 715bdfb..5022542 100644 --- a/chrome/browser/sync/glue/password_change_processor.cc +++ b/chrome/browser/sync/glue/password_change_processor.cc @@ -21,8 +21,8 @@ #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/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" #include "webkit/glue/password_form.h" namespace browser_sync { @@ -50,9 +50,10 @@ PasswordChangeProcessor::~PasswordChangeProcessor() { DCHECK(expected_loop_ == MessageLoop::current()); } -void PasswordChangeProcessor::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { +void PasswordChangeProcessor::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(expected_loop_ == MessageLoop::current()); DCHECK(chrome::NOTIFICATION_LOGINS_CHANGED == type); if (!observing_) @@ -71,7 +72,7 @@ void PasswordChangeProcessor::Observe(int type, } PasswordStoreChangeList* changes = - Details<PasswordStoreChangeList>(details).ptr(); + content::Details<PasswordStoreChangeList>(details).ptr(); for (PasswordStoreChangeList::iterator change = changes->begin(); change != changes->end(); ++change) { std::string tag = PasswordModelAssociator::MakeTag(change->form()); @@ -227,14 +228,15 @@ void PasswordChangeProcessor::StartObserving() { DCHECK(expected_loop_ == MessageLoop::current()); notification_registrar_.Add(this, chrome::NOTIFICATION_LOGINS_CHANGED, - Source<PasswordStore>(password_store_)); + content::Source<PasswordStore>(password_store_)); } void PasswordChangeProcessor::StopObserving() { DCHECK(expected_loop_ == MessageLoop::current()); - notification_registrar_.Remove(this, - chrome::NOTIFICATION_LOGINS_CHANGED, - Source<PasswordStore>(password_store_)); + notification_registrar_.Remove( + this, + chrome::NOTIFICATION_LOGINS_CHANGED, + content::Source<PasswordStore>(password_store_)); } } // namespace browser_sync diff --git a/chrome/browser/sync/glue/password_change_processor.h b/chrome/browser/sync/glue/password_change_processor.h index a71f0f6..87a6409 100644 --- a/chrome/browser/sync/glue/password_change_processor.h +++ b/chrome/browser/sync/glue/password_change_processor.h @@ -12,8 +12,8 @@ #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/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_types.h" class PasswordStore; @@ -29,18 +29,18 @@ class UnrecoverableErrorHandler; // operations and use of this class are from the DB thread on Windows and Linux, // or the password thread on Mac. class PasswordChangeProcessor : public ChangeProcessor, - public NotificationObserver { + public content::NotificationObserver { public: PasswordChangeProcessor(PasswordModelAssociator* model_associator, PasswordStore* password_store, UnrecoverableErrorHandler* error_handler); virtual ~PasswordChangeProcessor(); - // NotificationObserver implementation. + // content::NotificationObserver implementation. // Passwords -> sync_api model change application. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) OVERRIDE; + const content::NotificationSource& source, + const content::NotificationDetails& details) OVERRIDE; // sync_api model -> WebDataService change application. virtual void ApplyChangesFromSyncModel( @@ -75,7 +75,7 @@ class PasswordChangeProcessor : public ChangeProcessor, PasswordModelAssociator::PasswordVector updated_passwords_; PasswordModelAssociator::PasswordVector deleted_passwords_; - NotificationRegistrar notification_registrar_; + content::NotificationRegistrar notification_registrar_; bool observing_; diff --git a/chrome/browser/sync/glue/search_engine_data_type_controller.cc b/chrome/browser/sync/glue/search_engine_data_type_controller.cc index 9f90cd5..25c9f5b 100644 --- a/chrome/browser/sync/glue/search_engine_data_type_controller.cc +++ b/chrome/browser/sync/glue/search_engine_data_type_controller.cc @@ -12,7 +12,7 @@ #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/common/notification_source.h" +#include "content/public/browser/notification_source.h" namespace browser_sync { @@ -34,8 +34,8 @@ syncable::ModelType SearchEngineDataTypeController::type() const { void SearchEngineDataTypeController::Observe( int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_EQ(chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, type); registrar_.RemoveAll(); @@ -55,7 +55,7 @@ bool SearchEngineDataTypeController::StartModels() { // Add an observer and continue when the TemplateURLService is loaded. registrar_.Add(this, chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, - Source<TemplateURLService>(turl_service)); + content::Source<TemplateURLService>(turl_service)); return false; // Don't continue Start. } diff --git a/chrome/browser/sync/glue/search_engine_data_type_controller.h b/chrome/browser/sync/glue/search_engine_data_type_controller.h index 61d9f87..e4460e2 100644 --- a/chrome/browser/sync/glue/search_engine_data_type_controller.h +++ b/chrome/browser/sync/glue/search_engine_data_type_controller.h @@ -11,13 +11,13 @@ #include "base/compiler_specific.h" #include "chrome/browser/sync/glue/generic_change_processor.h" #include "chrome/browser/sync/glue/frontend_data_type_controller.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" namespace browser_sync { class SearchEngineDataTypeController : public FrontendDataTypeController, - public NotificationObserver { + public content::NotificationObserver { public: SearchEngineDataTypeController( ProfileSyncFactory* profile_sync_factory, @@ -28,10 +28,10 @@ class SearchEngineDataTypeController : public FrontendDataTypeController, // FrontendDataTypeController implementation. virtual syncable::ModelType type() const OVERRIDE; - // NotificationObserver interface. + // content::NotificationObserver interface. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) OVERRIDE; + const content::NotificationSource& source, + const content::NotificationDetails& details) OVERRIDE; protected: virtual GenericChangeProcessor* change_processor() const OVERRIDE; @@ -49,7 +49,7 @@ class SearchEngineDataTypeController : public FrontendDataTypeController, scoped_ptr<GenericChangeProcessor> generic_change_processor_; - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; DISALLOW_COPY_AND_ASSIGN(SearchEngineDataTypeController); }; diff --git a/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc b/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc index e618f8e..a2abcb9 100644 --- a/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc @@ -109,7 +109,7 @@ TEST_F(SearchEngineDataTypeControllerTest, StartURLServiceNotReady) { // Send the notification that the TemplateURLService has started. NotificationService::current()->Notify( chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, - Source<TemplateURLService>(test_util_.model()), + content::Source<TemplateURLService>(test_util_.model()), NotificationService::NoDetails()); EXPECT_EQ(DataTypeController::RUNNING, search_engine_dtc_->state()); } diff --git a/chrome/browser/sync/glue/session_change_processor.cc b/chrome/browser/sync/glue/session_change_processor.cc index 5ce3ba6..45b4d9e 100644 --- a/chrome/browser/sync/glue/session_change_processor.cc +++ b/chrome/browser/sync/glue/session_change_processor.cc @@ -21,9 +21,9 @@ #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" #include "content/common/notification_service.h" -#include "content/common/notification_source.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" namespace browser_sync { @@ -31,9 +31,10 @@ namespace { // Extract the source SyncedTabDelegate from a NotificationSource originating // from a NavigationController, if it exists. Returns |NULL| otherwise. -SyncedTabDelegate* ExtractSyncedTabDelegate(const NotificationSource& source) { +SyncedTabDelegate* ExtractSyncedTabDelegate( + const content::NotificationSource& source) { TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( - Source<NavigationController>(source).ptr()->tab_contents()); + content::Source<NavigationController>(source).ptr()->tab_contents()); if (!tab) return NULL; return tab->synced_tab_delegate(); @@ -70,9 +71,10 @@ SessionChangeProcessor::~SessionChangeProcessor() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); } -void SessionChangeProcessor::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { +void SessionChangeProcessor::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(running()); DCHECK(profile_); @@ -81,7 +83,7 @@ void SessionChangeProcessor::Observe(int type, std::vector<SyncedTabDelegate*> modified_tabs; switch (type) { case chrome::NOTIFICATION_BROWSER_OPENED: { - Browser* browser = Source<Browser>(source).ptr(); + Browser* browser = content::Source<Browser>(source).ptr(); if (!browser || browser->profile() != profile_) { return; } @@ -90,7 +92,7 @@ void SessionChangeProcessor::Observe(int type, } case content::NOTIFICATION_TAB_PARENTED: { - SyncedTabDelegate* tab = Source<SyncedTabDelegate>(source).ptr(); + SyncedTabDelegate* tab = content::Source<SyncedTabDelegate>(source).ptr(); if (!tab || tab->profile() != profile_) { return; } @@ -102,7 +104,7 @@ void SessionChangeProcessor::Observe(int type, case content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME: { TabContentsWrapper* tab_contents_wrapper = TabContentsWrapper::GetCurrentWrapperForContents( - Source<TabContents>(source).ptr()); + content::Source<TabContents>(source).ptr()); if (!tab_contents_wrapper) { return; } @@ -157,7 +159,7 @@ void SessionChangeProcessor::Observe(int type, case chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED: { ExtensionTabHelper* extension_tab_helper = - Source<ExtensionTabHelper>(source).ptr(); + content::Source<ExtensionTabHelper>(source).ptr(); if (!extension_tab_helper || extension_tab_helper->tab_contents()->browser_context() != profile_) { return; @@ -270,7 +272,7 @@ void SessionChangeProcessor::ApplyChangesFromSyncModel( // Notify foreign session handlers that there are new sessions. NotificationService::current()->Notify( chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED, - Source<Profile>(profile_), + content::Source<Profile>(profile_), NotificationService::NoDetails()); StartObserving(); diff --git a/chrome/browser/sync/glue/session_change_processor.h b/chrome/browser/sync/glue/session_change_processor.h index a7fe920..bc6e1c6 100644 --- a/chrome/browser/sync/glue/session_change_processor.h +++ b/chrome/browser/sync/glue/session_change_processor.h @@ -11,13 +11,10 @@ #include "chrome/browser/sessions/session_backend.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sync/glue/change_processor.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_types.h" - -class NotificationDetails; -class NotificationSource; class Profile; namespace browser_sync { @@ -30,7 +27,7 @@ class UnrecoverableErrorHandler; // model, and vice versa. All operations and use of this class are // from the UI thread. class SessionChangeProcessor : public ChangeProcessor, - public NotificationObserver { + public content::NotificationObserver { public: // Does not take ownership of either argument. SessionChangeProcessor( @@ -42,11 +39,11 @@ class SessionChangeProcessor : public ChangeProcessor, bool setup_for_test); virtual ~SessionChangeProcessor(); - // NotificationObserver implementation. + // content::NotificationObserver implementation. // BrowserSessionProvider -> sync_api model change application. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) OVERRIDE; + const content::NotificationSource& source, + const content::NotificationDetails& details) OVERRIDE; // ChangeProcessor implementation. // sync_api model -> BrowserSessionProvider change application. @@ -63,7 +60,7 @@ class SessionChangeProcessor : public ChangeProcessor, void StartObserving(); void StopObserving(); SessionModelAssociator* session_model_associator_; - NotificationRegistrar notification_registrar_; + content::NotificationRegistrar notification_registrar_; // Owner of the SessionService. Non-NULL iff |running()| is true. Profile* profile_; diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc index e243085..73bf7cd 100644 --- a/chrome/browser/sync/glue/session_model_associator.cc +++ b/chrome/browser/sync/glue/session_model_associator.cc @@ -28,8 +28,8 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/url_constants.h" #include "content/browser/tab_contents/navigation_entry.h" -#include "content/common/notification_details.h" #include "content/common/notification_service.h" +#include "content/public/browser/notification_details.h" #if defined(OS_LINUX) #include "base/linux_util.h" #elif defined(OS_WIN) @@ -535,7 +535,7 @@ bool SessionModelAssociator::DisassociateModels(SyncError* error) { // foreign session handlers. NotificationService::current()->Notify( chrome::NOTIFICATION_FOREIGN_SESSION_DISABLED, - Source<Profile>(sync_service_->profile()), + content::Source<Profile>(sync_service_->profile()), 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 dfc8607..ff5374d 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -790,8 +790,8 @@ void SyncBackendHost::Core::NotifyUpdatedToken(const std::string& token) { TokenAvailableDetails details(GaiaConstants::kSyncService, token); NotificationService::current()->Notify( chrome::NOTIFICATION_TOKEN_UPDATED, - Source<Profile>(host_->profile_), - Details<const TokenAvailableDetails>(&details)); + content::Source<Profile>(host_->profile_), + content::Details<const TokenAvailableDetails>(&details)); } void SyncBackendHost::Core::NotifyEncryptionComplete( diff --git a/chrome/browser/sync/glue/theme_change_processor.cc b/chrome/browser/sync/glue/theme_change_processor.cc index 2b6a77d..c32b26b 100644 --- a/chrome/browser/sync/glue/theme_change_processor.cc +++ b/chrome/browser/sync/glue/theme_change_processor.cc @@ -18,8 +18,8 @@ #include "chrome/browser/themes/theme_service.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" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" namespace browser_sync { @@ -32,9 +32,10 @@ ThemeChangeProcessor::ThemeChangeProcessor( ThemeChangeProcessor::~ThemeChangeProcessor() {} -void ThemeChangeProcessor::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { +void ThemeChangeProcessor::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(running()); DCHECK(profile_); DCHECK(type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED); @@ -126,7 +127,7 @@ void ThemeChangeProcessor::StartObserving() { VLOG(1) << "Observing BROWSER_THEME_CHANGED"; notification_registrar_.Add( this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, - Source<ThemeService>( + content::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 7651bce..7e6906f 100644 --- a/chrome/browser/sync/glue/theme_change_processor.h +++ b/chrome/browser/sync/glue/theme_change_processor.h @@ -9,12 +9,10 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "chrome/browser/sync/glue/change_processor.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_types.h" -class NotificationDetails; -class NotificationSource; class Profile; namespace browser_sync { @@ -26,16 +24,16 @@ class UnrecoverableErrorHandler; // model, and vice versa. All operations and use of this class are // from the UI thread. class ThemeChangeProcessor : public ChangeProcessor, - public NotificationObserver { + public content::NotificationObserver { public: explicit ThemeChangeProcessor(UnrecoverableErrorHandler* error_handler); virtual ~ThemeChangeProcessor(); - // NotificationObserver implementation. + // content::NotificationObserver implementation. // ThemeService -> sync_api model change application. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) OVERRIDE; + const content::NotificationSource& source, + const content::NotificationDetails& details) OVERRIDE; // ChangeProcessor implementation. // sync_api model -> ThemeService change application. @@ -52,7 +50,7 @@ class ThemeChangeProcessor : public ChangeProcessor, void StartObserving(); void StopObserving(); - NotificationRegistrar notification_registrar_; + content::NotificationRegistrar notification_registrar_; // Profile associated with the ThemeService. Non-NULL iff |running()| is // true. Profile* profile_; diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc index 067b7b2..b68b2a1 100644 --- a/chrome/browser/sync/glue/typed_url_change_processor.cc +++ b/chrome/browser/sync/glue/typed_url_change_processor.cc @@ -56,9 +56,10 @@ TypedUrlChangeProcessor::~TypedUrlChangeProcessor() { DCHECK(expected_loop_ == MessageLoop::current()); } -void TypedUrlChangeProcessor::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { +void TypedUrlChangeProcessor::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(expected_loop_ == MessageLoop::current()); if (!observing_) return; @@ -69,11 +70,14 @@ void TypedUrlChangeProcessor::Observe(int 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()); + HandleURLsModified( + content::Details<history::URLsModifiedDetails>(details).ptr()); } else if (type == chrome::NOTIFICATION_HISTORY_URLS_DELETED) { - HandleURLsDeleted(Details<history::URLsDeletedDetails>(details).ptr()); + HandleURLsDeleted( + content::Details<history::URLsDeletedDetails>(details).ptr()); } else if (type == chrome::NOTIFICATION_HISTORY_URL_VISITED) { - HandleURLsVisited(Details<history::URLVisitedDetails>(details).ptr()); + HandleURLsVisited( + content::Details<history::URLVisitedDetails>(details).ptr()); } } @@ -349,13 +353,13 @@ void TypedUrlChangeProcessor::StartObserving() { DCHECK(profile_); notification_registrar_.Add( this, chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED, - Source<Profile>(profile_)); + content::Source<Profile>(profile_)); notification_registrar_.Add( this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, - Source<Profile>(profile_)); + content::Source<Profile>(profile_)); notification_registrar_.Add( this, chrome::NOTIFICATION_HISTORY_URL_VISITED, - Source<Profile>(profile_)); + content::Source<Profile>(profile_)); } void TypedUrlChangeProcessor::StopObserving() { @@ -363,13 +367,13 @@ void TypedUrlChangeProcessor::StopObserving() { DCHECK(profile_); notification_registrar_.Remove( this, chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED, - Source<Profile>(profile_)); + content::Source<Profile>(profile_)); notification_registrar_.Remove( this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, - Source<Profile>(profile_)); + content::Source<Profile>(profile_)); notification_registrar_.Remove( this, chrome::NOTIFICATION_HISTORY_URL_VISITED, - Source<Profile>(profile_)); + content::Source<Profile>(profile_)); } } // namespace browser_sync diff --git a/chrome/browser/sync/glue/typed_url_change_processor.h b/chrome/browser/sync/glue/typed_url_change_processor.h index cbb9bf5..a8c3044 100644 --- a/chrome/browser/sync/glue/typed_url_change_processor.h +++ b/chrome/browser/sync/glue/typed_url_change_processor.h @@ -13,8 +13,8 @@ #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/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_types.h" class MessageLoop; @@ -37,7 +37,7 @@ class UnrecoverableErrorHandler; // applying them to the sync_api 'syncable' model, and vice versa. All // operations and use of this class are from the UI thread. class TypedUrlChangeProcessor : public ChangeProcessor, - public NotificationObserver { + public content::NotificationObserver { public: TypedUrlChangeProcessor(Profile* profile, TypedUrlModelAssociator* model_associator, @@ -45,11 +45,11 @@ class TypedUrlChangeProcessor : public ChangeProcessor, UnrecoverableErrorHandler* error_handler); virtual ~TypedUrlChangeProcessor(); - // NotificationObserver implementation. + // content::NotificationObserver implementation. // History -> sync_api model change application. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details); + const content::NotificationSource& source, + const content::NotificationDetails& details); // sync_api model -> WebDataService change application. virtual void ApplyChangesFromSyncModel( @@ -95,7 +95,7 @@ class TypedUrlChangeProcessor : public ChangeProcessor, // holding a reference. history::HistoryBackend* history_backend_; - NotificationRegistrar notification_registrar_; + content::NotificationRegistrar notification_registrar_; bool observing_; // True when we should observe notifications. 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 2bfd46a..610ce0e 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.cc +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.cc @@ -98,13 +98,14 @@ void TypedUrlDataTypeController::CreateSyncComponents() { set_change_processor(sync_components.change_processor); } -void TypedUrlDataTypeController::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { +void TypedUrlDataTypeController::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); switch (type) { case chrome::NOTIFICATION_PREF_CHANGED: - DCHECK(*Details<std::string>(details).ptr() == + DCHECK(*content::Details<std::string>(details).ptr() == prefs::kSavingBrowserHistoryDisabled); if (profile()->GetPrefs()->GetBoolean( prefs::kSavingBrowserHistoryDisabled)) { 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 ba553f66..bcfae38 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.h +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.h @@ -12,12 +12,10 @@ #include "chrome/browser/sync/glue/non_frontend_data_type_controller.h" #include "content/browser/cancelable_request.h" #include "chrome/browser/prefs/pref_change_registrar.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_types.h" -class NotificationSource; -class NotificationDetails; class HistoryService; namespace history { @@ -30,7 +28,7 @@ class ControlTask; // A class that manages the startup and shutdown of typed_url sync. class TypedUrlDataTypeController : public NonFrontendDataTypeController, - public NotificationObserver { + public content::NotificationObserver { public: TypedUrlDataTypeController( ProfileSyncFactory* profile_sync_factory, @@ -41,10 +39,10 @@ class TypedUrlDataTypeController : public NonFrontendDataTypeController, virtual syncable::ModelType type() const OVERRIDE; virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE; - // NotificationObserver implementation. + // content::NotificationObserver implementation. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details); + const content::NotificationSource& source, + const content::NotificationDetails& details); // CancelableRequestConsumerBase implementation. virtual void OnRequestAdded(CancelableRequestProvider* provider, @@ -76,7 +74,7 @@ class TypedUrlDataTypeController : public NonFrontendDataTypeController, history::HistoryBackend* backend_; scoped_refptr<HistoryService> history_service_; - NotificationRegistrar notification_registrar_; + content::NotificationRegistrar notification_registrar_; PrefChangeRegistrar pref_registrar_; // Helper object to make sure we don't leave tasks running on the history |