diff options
Diffstat (limited to 'chrome/browser/sync')
49 files changed, 331 insertions, 327 deletions
diff --git a/chrome/browser/sync/backend_migrator.cc b/chrome/browser/sync/backend_migrator.cc index 47fb4d6..cb6a0d2 100644 --- a/chrome/browser/sync/backend_migrator.cc +++ b/chrome/browser/sync/backend_migrator.cc @@ -16,8 +16,8 @@ #include "chrome/browser/sync/sessions/session_state.h" #include "chrome/browser/sync/syncable/directory_manager.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" using syncable::ModelTypeSet; @@ -36,7 +36,7 @@ BackendMigrator::BackendMigrator(const std::string& name, manager_(manager), state_(IDLE), weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { registrar_.Add(this, chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, - Source<DataTypeManager>(manager_)); + content::Source<DataTypeManager>(manager_)); } BackendMigrator::~BackendMigrator() { @@ -134,8 +134,8 @@ void BackendMigrator::RestartMigration() { } void BackendMigrator::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK_EQ(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, type); if (state_ == IDLE) return; @@ -147,7 +147,8 @@ void BackendMigrator::Observe(int type, FROM_HERE, base::Bind(&BackendMigrator::OnConfigureDone, weak_ptr_factory_.GetWeakPtr(), - *Details<DataTypeManager::ConfigureResult>(details).ptr())); + *content::Details<DataTypeManager::ConfigureResult>( + details).ptr())); } namespace { diff --git a/chrome/browser/sync/backend_migrator.h b/chrome/browser/sync/backend_migrator.h index d1c409d..7e771cb 100644 --- a/chrome/browser/sync/backend_migrator.h +++ b/chrome/browser/sync/backend_migrator.h @@ -11,8 +11,8 @@ #include "base/task.h" #include "chrome/browser/sync/glue/data_type_manager.h" #include "chrome/browser/sync/syncable/model_type.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 ProfileSyncService; @@ -34,7 +34,7 @@ class MigrationObserver { // A class to perform migration of a datatype pursuant to the 'MIGRATION_DONE' // code in the sync protocol definition (protocol/sync.proto). -class BackendMigrator : public NotificationObserver { +class BackendMigrator : public content::NotificationObserver { public: enum State { IDLE, @@ -61,10 +61,10 @@ class BackendMigrator : public NotificationObserver { bool HasMigrationObserver(MigrationObserver* observer) const; void RemoveMigrationObserver(MigrationObserver* observer); - // 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; State state() const; @@ -93,7 +93,7 @@ class BackendMigrator : public NotificationObserver { State state_; - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; ObserverList<MigrationObserver> migration_observers_; diff --git a/chrome/browser/sync/backend_migrator_unittest.cc b/chrome/browser/sync/backend_migrator_unittest.cc index 75a0248..0f10842 100644 --- a/chrome/browser/sync/backend_migrator_unittest.cc +++ b/chrome/browser/sync/backend_migrator_unittest.cc @@ -79,8 +79,8 @@ class BackendMigratorTest : public testing::Test { DataTypeManager::ConfigureResult result(status, requested_types); NotificationService::current()->Notify( chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, - Source<DataTypeManager>(&manager_), - Details<const DataTypeManager::ConfigureResult>(&result)); + content::Source<DataTypeManager>(&manager_), + content::Details<const DataTypeManager::ConfigureResult>(&result)); } else { std::list<SyncError> errors; DataTypeManager::ConfigureResult result( @@ -89,8 +89,8 @@ class BackendMigratorTest : public testing::Test { errors); NotificationService::current()->Notify( chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, - Source<DataTypeManager>(&manager_), - Details<const DataTypeManager::ConfigureResult>(&result)); + content::Source<DataTypeManager>(&manager_), + content::Details<const DataTypeManager::ConfigureResult>(&result)); } message_loop_.RunAllPending(); } 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 diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 57f9065..500ec09 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -56,8 +56,8 @@ #include "chrome/common/net/gaia/gaia_constants.h" #include "chrome/common/time_format.h" #include "chrome/common/url_constants.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 "grit/generated_resources.h" #include "net/base/cookie_monster.h" #include "ui/base/l10n/l10n_util.h" @@ -205,16 +205,16 @@ void ProfileSyncService::Initialize() { void ProfileSyncService::RegisterAuthNotifications() { registrar_.Add(this, chrome::NOTIFICATION_TOKEN_AVAILABLE, - Source<TokenService>(profile_->GetTokenService())); + content::Source<TokenService>(profile_->GetTokenService())); registrar_.Add(this, chrome::NOTIFICATION_TOKEN_LOADING_FINISHED, - Source<TokenService>(profile_->GetTokenService())); + content::Source<TokenService>(profile_->GetTokenService())); registrar_.Add(this, chrome::NOTIFICATION_TOKEN_REQUEST_FAILED, - Source<TokenService>(profile_->GetTokenService())); + content::Source<TokenService>(profile_->GetTokenService())); registrar_.Add(this, chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED, - Source<Profile>(profile_)); + content::Source<Profile>(profile_)); } void ProfileSyncService::RegisterDataTypeController( @@ -390,12 +390,14 @@ void ProfileSyncService::Shutdown(bool sync_disabled) { data_type_manager_->Stop(); } - registrar_.Remove(this, - chrome::NOTIFICATION_SYNC_CONFIGURE_START, - Source<DataTypeManager>(data_type_manager_.get())); - registrar_.Remove(this, - chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, - Source<DataTypeManager>(data_type_manager_.get())); + registrar_.Remove( + this, + chrome::NOTIFICATION_SYNC_CONFIGURE_START, + content::Source<DataTypeManager>(data_type_manager_.get())); + registrar_.Remove( + this, + chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, + content::Source<DataTypeManager>(data_type_manager_.get())); data_type_manager_.reset(); } @@ -1202,10 +1204,10 @@ void ProfileSyncService::ConfigureDataTypeManager() { &data_type_controllers_)); registrar_.Add(this, chrome::NOTIFICATION_SYNC_CONFIGURE_START, - Source<DataTypeManager>(data_type_manager_.get())); + content::Source<DataTypeManager>(data_type_manager_.get())); registrar_.Add(this, chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, - Source<DataTypeManager>(data_type_manager_.get())); + content::Source<DataTypeManager>(data_type_manager_.get())); // We create the migrator at the same time. migrator_.reset( @@ -1361,8 +1363,8 @@ void ProfileSyncService::OnSyncManagedPrefChange(bool is_sync_managed) { } void ProfileSyncService::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { switch (type) { case chrome::NOTIFICATION_SYNC_CONFIGURE_START: { NotifyObservers(); @@ -1371,7 +1373,7 @@ void ProfileSyncService::Observe(int type, } case chrome::NOTIFICATION_SYNC_CONFIGURE_DONE: { DataTypeManager::ConfigureResult* result = - Details<DataTypeManager::ConfigureResult>(details).ptr(); + content::Details<DataTypeManager::ConfigureResult>(details).ptr(); DataTypeManager::ConfigureStatus status = result->status; VLOG(1) << "PSS SYNC_CONFIGURE_DONE called with status: " << status; @@ -1424,7 +1426,7 @@ void ProfileSyncService::Observe(int type, } case chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED: { GoogleServiceAuthError error = - *(Details<const GoogleServiceAuthError>(details).ptr()); + *(content::Details<const GoogleServiceAuthError>(details).ptr()); UpdateAuthErrorState(error); break; } diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index 7cfcbbe..3aeed83 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -32,13 +32,11 @@ #include "chrome/browser/sync/sync_setup_wizard.h" #include "chrome/browser/sync/unrecoverable_error_handler.h" #include "chrome/common/net/gaia/google_service_auth_error.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" #include "googleurl/src/gurl.h" -class NotificationDetails; -class NotificationSource; class Profile; class ProfileSyncFactory; class SigninManager; @@ -105,7 +103,7 @@ struct UserShare; class ProfileSyncService : public browser_sync::SyncFrontend, public browser_sync::SyncPrefObserver, public browser_sync::UnrecoverableErrorHandler, - public NotificationObserver { + public content::NotificationObserver { public: typedef ProfileSyncServiceObserver Observer; typedef browser_sync::SyncBackendHost::Status Status; @@ -403,10 +401,10 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // SyncPrefObserver implementation. virtual void OnSyncManagedPrefChange(bool is_sync_managed) 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; // Changes which data types we're going to be syncing to |preferred_types|. // If it is running, the DataTypeManager will be instructed to reconfigure @@ -638,7 +636,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, browser_sync::SyncJsController sync_js_controller_; - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; ScopedRunnableMethodFactory<ProfileSyncService> scoped_runnable_method_factory_; diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc index 7274ede..96553ed 100644 --- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc @@ -53,7 +53,7 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/net/gaia/gaia_constants.h" #include "content/browser/browser_thread.h" -#include "content/common/notification_source.h" +#include "content/public/browser/notification_source.h" #include "testing/gmock/include/gmock/gmock.h" using base::Time; @@ -938,8 +938,8 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeAddEntry) { changes.push_back(AutofillChange(AutofillChange::ADD, added_entry.key())); scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, - Source<WebDataService>(web_data_service_.get()), - Details<AutofillChangeList>(&changes)); + content::Source<WebDataService>(web_data_service_.get()), + content::Details<AutofillChangeList>(&changes)); std::vector<AutofillEntry> new_sync_entries; std::vector<AutofillProfile> new_sync_profiles; @@ -967,8 +967,8 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeAddProfile) { added_profile.guid(), &added_profile); scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED, - Source<WebDataService>(web_data_service_.get()), - Details<AutofillProfileChange>(&change)); + content::Source<WebDataService>(web_data_service_.get()), + content::Details<AutofillProfileChange>(&change)); std::vector<AutofillProfile> new_sync_profiles; ASSERT_TRUE(GetAutofillProfilesFromSyncDBUnderProfileNode( @@ -1001,8 +1001,8 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeUpdateEntry) { updated_entry.key())); scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, - Source<WebDataService>(web_data_service_.get()), - Details<AutofillChangeList>(&changes)); + content::Source<WebDataService>(web_data_service_.get()), + content::Details<AutofillChangeList>(&changes)); std::vector<AutofillEntry> new_sync_entries; std::vector<AutofillProfile> new_sync_profiles; @@ -1031,8 +1031,8 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeRemoveEntry) { original_entry.key())); scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, - Source<WebDataService>(web_data_service_.get()), - Details<AutofillChangeList>(&changes)); + content::Source<WebDataService>(web_data_service_.get()), + content::Details<AutofillChangeList>(&changes)); std::vector<AutofillEntry> new_sync_entries; std::vector<AutofillProfile> new_sync_profiles; @@ -1069,8 +1069,8 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeRemoveProfile) { sync_profile.guid(), NULL); scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED, - Source<WebDataService>(web_data_service_.get()), - Details<AutofillProfileChange>(&change)); + content::Source<WebDataService>(web_data_service_.get()), + content::Details<AutofillProfileChange>(&change)); std::vector<AutofillProfile> new_sync_profiles; ASSERT_TRUE(GetAutofillProfilesFromSyncDBUnderProfileNode( @@ -1096,8 +1096,8 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeError) { evil_entry.key())); scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, - Source<WebDataService>(web_data_service_.get()), - Details<AutofillChangeList>(&changes)); + content::Source<WebDataService>(web_data_service_.get()), + content::Details<AutofillChangeList>(&changes)); // Wait for the PPS to shut everything down and signal us. ProfileSyncServiceObserverMock observer; @@ -1108,8 +1108,8 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeError) { // Ensure future autofill notifications don't crash. notifier->Notify(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, - Source<WebDataService>(web_data_service_.get()), - Details<AutofillChangeList>(&changes)); + content::Source<WebDataService>(web_data_service_.get()), + content::Details<AutofillChangeList>(&changes)); } // Crashy, http://crbug.com/57884 diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc index d7310fb..064e946 100644 --- a/chrome/browser/sync/profile_sync_service_password_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc @@ -36,8 +36,8 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/profile_mock.h" #include "content/browser/browser_thread.h" -#include "content/common/notification_observer_mock.h" -#include "content/common/notification_source.h" +#include "content/public/browser/notification_source.h" +#include "content/test/notification_observer_mock.h" #include "testing/gmock/include/gmock/gmock.h" #include "webkit/glue/password_form.h" @@ -303,10 +303,10 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest { friend class AddPasswordEntriesTask; scoped_refptr<ThreadNotificationService> notification_service_; - NotificationObserverMock observer_; + content::NotificationObserverMock observer_; ProfileMock profile_; scoped_refptr<MockPasswordStore> password_store_; - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; }; class AddPasswordEntriesTask : public Task { diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc index d8560e6..1ff13f6 100644 --- a/chrome/browser/sync/profile_sync_service_session_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc @@ -39,8 +39,8 @@ #include "chrome/test/base/profile_mock.h" #include "chrome/test/base/testing_profile.h" #include "content/browser/browser_thread.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/common/notification_service.h" #include "googleurl/src/gurl.h" #include "testing/gmock/include/gmock/gmock.h" @@ -149,7 +149,7 @@ void VerifySyncedSession( class ProfileSyncServiceSessionTest : public BrowserWithTestWindowTest, - public NotificationObserver { + public content::NotificationObserver { public: ProfileSyncServiceSessionTest() : io_thread_(BrowserThread::IO), @@ -181,8 +181,8 @@ class ProfileSyncServiceSessionTest } void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { switch (type) { case chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED: notified_of_update_ = true; @@ -257,7 +257,7 @@ class ProfileSyncServiceSessionTest scoped_ptr<TestProfileSyncService> sync_service_; const gfx::Rect window_bounds_; bool notified_of_update_; - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; }; class CreateRootTask : public Task { diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc index 925cd25..c55408a9 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -443,8 +443,8 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAdd) { details.changed_urls.push_back(added_entry); scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); notifier->Notify(chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED, - Source<Profile>(&profile_), - Details<history::URLsModifiedDetails>(&details)); + content::Source<Profile>(&profile_), + content::Details<history::URLsModifiedDetails>(&details)); std::vector<history::URLRow> new_sync_entries; GetTypedUrlsFromSyncDB(&new_sync_entries); @@ -480,8 +480,8 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdate) { details.changed_urls.push_back(updated_entry); scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); notifier->Notify(chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED, - Source<Profile>(&profile_), - Details<history::URLsModifiedDetails>(&details)); + content::Source<Profile>(&profile_), + content::Details<history::URLsModifiedDetails>(&details)); std::vector<history::URLRow> new_sync_entries; GetTypedUrlsFromSyncDB(&new_sync_entries); @@ -508,8 +508,8 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAddFromVisit) { details.transition = content::PAGE_TRANSITION_TYPED; scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED, - Source<Profile>(&profile_), - Details<history::URLVisitedDetails>(&details)); + content::Source<Profile>(&profile_), + content::Details<history::URLVisitedDetails>(&details)); std::vector<history::URLRow> new_sync_entries; GetTypedUrlsFromSyncDB(&new_sync_entries); @@ -546,8 +546,8 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdateFromVisit) { details.transition = content::PAGE_TRANSITION_TYPED; scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED, - Source<Profile>(&profile_), - Details<history::URLVisitedDetails>(&details)); + content::Source<Profile>(&profile_), + content::Details<history::URLVisitedDetails>(&details)); std::vector<history::URLRow> new_sync_entries; GetTypedUrlsFromSyncDB(&new_sync_entries); @@ -586,8 +586,8 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserIgnoreChangeUpdateFromVisit) { details.transition = content::PAGE_TRANSITION_RELOAD; scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED, - Source<Profile>(&profile_), - Details<history::URLVisitedDetails>(&details)); + content::Source<Profile>(&profile_), + content::Details<history::URLVisitedDetails>(&details)); GetTypedUrlsFromSyncDB(&new_sync_entries); @@ -603,8 +603,8 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserIgnoreChangeUpdateFromVisit) { details.row = twelve_visits; details.transition = content::PAGE_TRANSITION_TYPED; notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED, - Source<Profile>(&profile_), - Details<history::URLVisitedDetails>(&details)); + content::Source<Profile>(&profile_), + content::Details<history::URLVisitedDetails>(&details)); GetTypedUrlsFromSyncDB(&new_sync_entries); // Should be no changes to the sync DB from this notification. ASSERT_EQ(1U, new_sync_entries.size()); @@ -618,8 +618,8 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserIgnoreChangeUpdateFromVisit) { details.row = twenty_visits; details.transition = content::PAGE_TRANSITION_TYPED; notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED, - Source<Profile>(&profile_), - Details<history::URLVisitedDetails>(&details)); + content::Source<Profile>(&profile_), + content::Details<history::URLVisitedDetails>(&details)); GetTypedUrlsFromSyncDB(&new_sync_entries); ASSERT_EQ(1U, new_sync_entries.size()); EXPECT_TRUE(URLsEqual(twenty_visits, new_sync_entries[0])); @@ -652,8 +652,8 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemove) { changes.urls.insert(GURL("http://mine.com")); scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); notifier->Notify(chrome::NOTIFICATION_HISTORY_URLS_DELETED, - Source<Profile>(&profile_), - Details<history::URLsDeletedDetails>(&changes)); + content::Source<Profile>(&profile_), + content::Details<history::URLsDeletedDetails>(&changes)); std::vector<history::URLRow> new_sync_entries; GetTypedUrlsFromSyncDB(&new_sync_entries); @@ -687,8 +687,8 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemoveAll) { changes.all_history = true; scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); notifier->Notify(chrome::NOTIFICATION_HISTORY_URLS_DELETED, - Source<Profile>(&profile_), - Details<history::URLsDeletedDetails>(&changes)); + content::Source<Profile>(&profile_), + content::Details<history::URLsDeletedDetails>(&changes)); std::vector<history::URLRow> new_sync_entries; GetTypedUrlsFromSyncDB(&new_sync_entries); diff --git a/chrome/browser/sync/profile_sync_test_util.cc b/chrome/browser/sync/profile_sync_test_util.cc index 26c89a4..c37680c 100644 --- a/chrome/browser/sync/profile_sync_test_util.cc +++ b/chrome/browser/sync/profile_sync_test_util.cc @@ -50,13 +50,13 @@ ThreadNotifier::ThreadNotifier(base::Thread* notify_thread) notify_thread_(notify_thread) {} void ThreadNotifier::Notify(int type, - const NotificationDetails& details) { + const content::NotificationDetails& details) { Notify(type, NotificationService::AllSources(), details); } void ThreadNotifier::Notify(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); notify_thread_->message_loop()->PostTask( FROM_HERE, @@ -71,8 +71,8 @@ void ThreadNotifier::Notify(int type, ThreadNotifier::~ThreadNotifier() {} void ThreadNotifier::NotifyTask(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { NotificationService::current()->Notify(type, source, details); done_event_.Signal(); } diff --git a/chrome/browser/sync/profile_sync_test_util.h b/chrome/browser/sync/profile_sync_test_util.h index 3da28bc..8aaeed3 100644 --- a/chrome/browser/sync/profile_sync_test_util.h +++ b/chrome/browser/sync/profile_sync_test_util.h @@ -15,7 +15,7 @@ #include "chrome/browser/sync/profile_sync_service_observer.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 "content/public/browser/notification_types.h" #include "testing/gmock/include/gmock/gmock.h" @@ -67,19 +67,19 @@ class ThreadNotifier : // NOLINT public: explicit ThreadNotifier(base::Thread* notify_thread); - void Notify(int type, const NotificationDetails& details); + void Notify(int type, const content::NotificationDetails& details); void Notify(int type, - const NotificationSource& source, - const NotificationDetails& details); + const content::NotificationSource& source, + const content::NotificationDetails& details); private: friend class base::RefCountedThreadSafe<ThreadNotifier>; virtual ~ThreadNotifier(); void NotifyTask(int type, - const NotificationSource& source, - const NotificationDetails& details); + const content::NotificationSource& source, + const content::NotificationDetails& details); base::WaitableEvent done_event_; base::Thread* notify_thread_; diff --git a/chrome/browser/sync/signin_manager.cc b/chrome/browser/sync/signin_manager.cc index 9932d54..05adf8b 100644 --- a/chrome/browser/sync/signin_manager.cc +++ b/chrome/browser/sync/signin_manager.cc @@ -53,7 +53,7 @@ bool SigninManager::IsInitialized() const { void SigninManager::CleanupNotificationRegistration() { #if !defined(OS_CHROMEOS) - Source<TokenService> token_service(profile_->GetTokenService()); + content::Source<TokenService> token_service(profile_->GetTokenService()); if (registrar_.IsRegistered(this, chrome::NOTIFICATION_TOKEN_AVAILABLE, token_service)) { @@ -139,7 +139,7 @@ void SigninManager::StartSignIn(const std::string& username, #if !defined(OS_CHROMEOS) registrar_.Add(this, chrome::NOTIFICATION_TOKEN_AVAILABLE, - Source<TokenService>(profile_->GetTokenService())); + content::Source<TokenService>(profile_->GetTokenService())); #endif } @@ -200,8 +200,8 @@ void SigninManager::OnGetUserInfoSuccess(const std::string& key, GoogleServiceSigninSuccessDetails details(username_, password_); NotificationService::current()->Notify( chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, - Source<Profile>(profile_), - Details<const GoogleServiceSigninSuccessDetails>(&details)); + content::Source<Profile>(profile_), + content::Details<const GoogleServiceSigninSuccessDetails>(&details)); password_.clear(); // Don't need it anymore. @@ -237,8 +237,8 @@ void SigninManager::OnClientLoginFailure(const GoogleServiceAuthError& error) { DCHECK(!browser_sync::IsUsingOAuth()); NotificationService::current()->Notify( chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED, - Source<Profile>(profile_), - Details<const GoogleServiceAuthError>(&error)); + content::Source<Profile>(profile_), + content::Details<const GoogleServiceAuthError>(&error)); // We don't sign-out if the password was valid and we're just dealing with // a second factor error, and we don't sign out if we're dealing with @@ -304,8 +304,8 @@ void SigninManager::OnUserInfoSuccess(const std::string& email) { GoogleServiceSigninSuccessDetails details(oauth_username_, ""); NotificationService::current()->Notify( chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, - Source<Profile>(profile_), - Details<const GoogleServiceSigninSuccessDetails>(&details)); + content::Source<Profile>(profile_), + content::Details<const GoogleServiceSigninSuccessDetails>(&details)); DCHECK(token_service->HasOAuthCredentials()); token_service->StartFetchingOAuthTokens(); @@ -317,12 +317,12 @@ void SigninManager::OnUserInfoFailure(const GoogleServiceAuthError& error) { } void SigninManager::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { #if !defined(OS_CHROMEOS) DCHECK(type == chrome::NOTIFICATION_TOKEN_AVAILABLE); TokenService::TokenAvailableDetails* tok_details = - Details<TokenService::TokenAvailableDetails>(details).ptr(); + content::Details<TokenService::TokenAvailableDetails>(details).ptr(); // If a GAIA service token has become available, use it to pre-login the // user to other services that depend on GAIA credentials. diff --git a/chrome/browser/sync/signin_manager.h b/chrome/browser/sync/signin_manager.h index e591bdf..3a34f45 100644 --- a/chrome/browser/sync/signin_manager.h +++ b/chrome/browser/sync/signin_manager.h @@ -18,8 +18,8 @@ #include "chrome/browser/net/gaia/gaia_oauth_fetcher.h" #include "chrome/common/net/gaia/gaia_auth_consumer.h" #include "chrome/common/net/gaia/google_service_auth_error.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 GaiaAuthFetcher; class Profile; @@ -39,7 +39,7 @@ struct GoogleServiceSigninSuccessDetails { class SigninManager : public GaiaAuthConsumer, public GaiaOAuthConsumer, - public NotificationObserver { + public content::NotificationObserver { public: SigninManager(); virtual ~SigninManager(); @@ -107,10 +107,10 @@ class SigninManager : public GaiaAuthConsumer, virtual void OnUserInfoSuccess(const std::string& email) OVERRIDE; virtual void OnUserInfoFailure(const GoogleServiceAuthError& error) OVERRIDE; - // NotificationObserver + // content::NotificationObserver virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) OVERRIDE; + const content::NotificationSource& source, + const content::NotificationDetails& details) OVERRIDE; private: void PrepareForSignin(); @@ -140,7 +140,7 @@ class SigninManager : public GaiaAuthConsumer, scoped_ptr<GaiaOAuthFetcher> oauth_login_; // Register for notifications from the TokenService. - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; DISALLOW_COPY_AND_ASSIGN(SigninManager); }; diff --git a/chrome/browser/sync/signin_manager_unittest.cc b/chrome/browser/sync/signin_manager_unittest.cc index 26cf2ae..f8a0cbd 100644 --- a/chrome/browser/sync/signin_manager_unittest.cc +++ b/chrome/browser/sync/signin_manager_unittest.cc @@ -26,9 +26,9 @@ class SigninManagerTest : public TokenServiceTestHarness { manager_.reset(new SigninManager()); google_login_success_.ListenFor( chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, - Source<Profile>(profile_.get())); + content::Source<Profile>(profile_.get())); google_login_failure_.ListenFor(chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED, - Source<Profile>(profile_.get())); + content::Source<Profile>(profile_.get())); originally_using_oauth_ = browser_sync::IsUsingOAuth(); } diff --git a/chrome/browser/sync/sync_prefs.cc b/chrome/browser/sync/sync_prefs.cc index 4a3dcd4..18d7456 100644 --- a/chrome/browser/sync/sync_prefs.cc +++ b/chrome/browser/sync/sync_prefs.cc @@ -11,8 +11,8 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.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 { @@ -291,14 +291,14 @@ void SyncPrefs::AcknowledgeSyncedTypes( } void SyncPrefs::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(non_thread_safe_.CalledOnValidThread()); - DCHECK(Source<PrefService>(pref_service_) == source); + DCHECK(content::Source<PrefService>(pref_service_) == source); switch (type) { case chrome::NOTIFICATION_PREF_CHANGED: { const std::string* pref_name = - Details<const std::string>(details).ptr(); + content::Details<const std::string>(details).ptr(); if (*pref_name == prefs::kSyncManaged) { FOR_EACH_OBSERVER(SyncPrefObserver, sync_pref_observers_, OnSyncManagedPrefChange(*pref_sync_managed_)); diff --git a/chrome/browser/sync/sync_prefs.h b/chrome/browser/sync/sync_prefs.h index 052304a..38b05c3 100644 --- a/chrome/browser/sync/sync_prefs.h +++ b/chrome/browser/sync/sync_prefs.h @@ -15,7 +15,7 @@ #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/sync/notifier/invalidation_version_tracker.h" #include "chrome/browser/sync/syncable/model_type.h" -#include "content/common/notification_observer.h" +#include "content/public/browser/notification_observer.h" class PrefService; @@ -46,7 +46,7 @@ class SyncPrefObserver { // two_client_preferences_sync_test.cc class SyncPrefs : public base::SupportsWeakPtr<SyncPrefs>, public sync_notifier::InvalidationVersionTracker, - public NotificationObserver { + public content::NotificationObserver { public: // |pref_service| may be NULL (for unit tests), but in that case no // setter methods should be called. Does not take ownership of @@ -105,10 +105,10 @@ class SyncPrefs : public base::SupportsWeakPtr<SyncPrefs>, // Merges the given set of types with the set of acknowledged types. void AcknowledgeSyncedTypes(const syncable::ModelTypeSet& types); - // 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; // For testing. diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc index 586cb0d..dbd7bbd 100644 --- a/chrome/browser/sync/test_profile_sync_service.cc +++ b/chrome/browser/sync/test_profile_sync_service.cc @@ -215,9 +215,10 @@ void TestProfileSyncService::OnBackendInitialized( } } -void TestProfileSyncService::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { +void TestProfileSyncService::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { ProfileSyncService::Observe(type, source, details); if (type == chrome::NOTIFICATION_SYNC_CONFIGURE_DONE && !synchronous_sync_configuration_) { diff --git a/chrome/browser/sync/test_profile_sync_service.h b/chrome/browser/sync/test_profile_sync_service.h index 406c9cc..246df47 100644 --- a/chrome/browser/sync/test_profile_sync_service.h +++ b/chrome/browser/sync/test_profile_sync_service.h @@ -82,8 +82,8 @@ class TestProfileSyncService : public ProfileSyncService { bool success) OVERRIDE; virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) OVERRIDE; + const content::NotificationSource& source, + const content::NotificationDetails& details) OVERRIDE; // If this is called, configuring data types will require a syncer // nudge. diff --git a/chrome/browser/sync/util/extensions_activity_monitor.cc b/chrome/browser/sync/util/extensions_activity_monitor.cc index d00a0b4..6a7cdcf 100644 --- a/chrome/browser/sync/util/extensions_activity_monitor.cc +++ b/chrome/browser/sync/util/extensions_activity_monitor.cc @@ -20,7 +20,7 @@ namespace { class RegistrationTask : public Task { public: RegistrationTask(ExtensionsActivityMonitor* monitor, - NotificationRegistrar* registrar) + content::NotificationRegistrar* registrar) : monitor_(monitor), registrar_(registrar) {} virtual ~RegistrationTask() {} @@ -39,7 +39,7 @@ class RegistrationTask : public Task { private: ExtensionsActivityMonitor* monitor_; - NotificationRegistrar* registrar_; + content::NotificationRegistrar* registrar_; DISALLOW_COPY_AND_ASSIGN(RegistrationTask); }; } // namespace @@ -80,13 +80,15 @@ void ExtensionsActivityMonitor::PutRecords(const Records& records) { } } -void ExtensionsActivityMonitor::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { +void ExtensionsActivityMonitor::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { base::AutoLock lock(records_lock_); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - const Extension* extension = Source<const Extension>(source).ptr(); - const BookmarksFunction* f = Details<const BookmarksFunction>(details).ptr(); + const Extension* extension = content::Source<const Extension>(source).ptr(); + const BookmarksFunction* f = + content::Details<const BookmarksFunction>(details).ptr(); if (f->name() == "bookmarks.update" || f->name() == "bookmarks.move" || f->name() == "bookmarks.create" || diff --git a/chrome/browser/sync/util/extensions_activity_monitor.h b/chrome/browser/sync/util/extensions_activity_monitor.h index 9166b70..0b76ce1 100644 --- a/chrome/browser/sync/util/extensions_activity_monitor.h +++ b/chrome/browser/sync/util/extensions_activity_monitor.h @@ -10,8 +10,8 @@ #include "base/message_loop.h" #include "base/synchronization/lock.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 { @@ -26,7 +26,7 @@ namespace browser_sync { // // Consider using MessageLoop::DeleteSoon. (Yes, this means if you allocate // an ExtensionsActivityMonitor on a thread other than UI, you must 'new' it). -class ExtensionsActivityMonitor : public NotificationObserver { +class ExtensionsActivityMonitor : public content::NotificationObserver { public: // A data record of activity performed by extension |extension_id|. struct Record { @@ -56,16 +56,16 @@ class ExtensionsActivityMonitor : public NotificationObserver { // This is done mutually exclusively w.r.t the methods of this class. void PutRecords(const Records& records); - // NotificationObserver implementation. Called on |ui_loop_|. + // content::NotificationObserver implementation. Called on |ui_loop_|. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details); + const content::NotificationSource& source, + const content::NotificationDetails& details); private: Records records_; mutable base::Lock records_lock_; // Used only from UI loop. - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; }; } // namespace browser_sync diff --git a/chrome/browser/sync/util/extensions_activity_monitor_unittest.cc b/chrome/browser/sync/util/extensions_activity_monitor_unittest.cc index 3631a77..7213af0 100644 --- a/chrome/browser/sync/util/extensions_activity_monitor_unittest.cc +++ b/chrome/browser/sync/util/extensions_activity_monitor_unittest.cc @@ -48,8 +48,8 @@ class BookmarkAPIEventTask : public Task { for (size_t i = 0; i < repeats_; i++) { NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED, - Source<Extension>(extension_.get()), - Details<const BookmarksFunction>(function_.get())); + content::Source<Extension>(extension_.get()), + content::Details<const BookmarksFunction>(function_.get())); } done_->Signal(); } |