diff options
author | blundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-13 13:10:45 +0000 |
---|---|---|
committer | blundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-13 13:10:45 +0000 |
commit | 396b0c71f6b94aadab9395a059d50ec282ff29e9 (patch) | |
tree | 31e568b8cfc45b2cf8babfe8bc9bfdb89888c653 /chrome/browser/sync | |
parent | d64bbadf8de48fab8dafa5874f51f5ae99c588cc (diff) | |
download | chromium_src-396b0c71f6b94aadab9395a059d50ec282ff29e9.zip chromium_src-396b0c71f6b94aadab9395a059d50ec282ff29e9.tar.gz chromium_src-396b0c71f6b94aadab9395a059d50ec282ff29e9.tar.bz2 |
Move clients of BrowserContextKeyedService to use KeyedService
The moved clients are the ones in:
- //chrome/browser/signin
- //chrome/browser/sync
- //chrome/browser/ui
BUG=351704
TBR=jochen
Review URL: https://codereview.chromium.org/197473005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256808 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
15 files changed, 35 insertions, 45 deletions
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 656fe1b..b94d98c 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc @@ -112,7 +112,7 @@ class FakeWebDataService : public AutofillWebDataService { class MockWebDataServiceWrapperSyncable : public MockWebDataServiceWrapper { public: - static BrowserContextKeyedService* Build(content::BrowserContext* profile) { + static KeyedService* Build(content::BrowserContext* profile) { return new MockWebDataServiceWrapperSyncable(); } 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 7898980..9d5f48e 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc @@ -21,7 +21,7 @@ #include "chrome/browser/sync/profile_sync_components_factory_mock.h" #include "chrome/browser/sync/profile_sync_service_mock.h" #include "chrome/test/base/profile_mock.h" -#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" +#include "components/keyed_service/content/refcounted_browser_context_keyed_service.h" #include "components/sync_driver/data_type_controller_mock.h" #include "components/sync_driver/model_associator_mock.h" #include "content/public/browser/notification_service.h" @@ -54,21 +54,19 @@ class HistoryMock : public HistoryService { virtual ~HistoryMock() {} }; -BrowserContextKeyedService* BuildBookmarkModel( - content::BrowserContext* context) { +KeyedService* BuildBookmarkModel(content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); BookmarkModel* bookmark_model = new BookmarkModel(profile); bookmark_model->Load(profile->GetIOTaskRunner()); return bookmark_model; } -BrowserContextKeyedService* BuildBookmarkModelWithoutLoading( +KeyedService* BuildBookmarkModelWithoutLoading( content::BrowserContext* profile) { return new BookmarkModel(static_cast<Profile*>(profile)); } -BrowserContextKeyedService* BuildHistoryService( - content::BrowserContext* profile) { +KeyedService* BuildHistoryService(content::BrowserContext* profile) { return new HistoryMock(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/sync/glue/favicon_cache.h b/chrome/browser/sync/glue/favicon_cache.h index ea4c8f5..7901684 100644 --- a/chrome/browser/sync/glue/favicon_cache.h +++ b/chrome/browser/sync/glue/favicon_cache.h @@ -44,7 +44,7 @@ enum IconSize { struct SyncedFaviconInfo; // Encapsulates the logic for loading and storing synced favicons. -// TODO(zea): make this a BrowserContextKeyedService. +// TODO(zea): make this a KeyedService. class FaviconCache : public syncer::SyncableService, public content::NotificationObserver { public: diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index 27cd83e..eb89d2f 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -28,7 +28,7 @@ #include "chrome/browser/sync/sessions2/sessions_sync_manager.h" #include "chrome/browser/sync/startup_controller.h" #include "chrome/browser/sync/sync_prefs.h" -#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/keyed_service/core/keyed_service.h" #include "components/sync_driver/data_type_controller.h" #include "components/sync_driver/data_type_encryption_handler.h" #include "components/sync_driver/data_type_manager.h" @@ -167,18 +167,17 @@ using browser_sync::SessionsSyncManager; // tell the sync engine that setup is completed and it can begin downloading // data from the sync server. // -class ProfileSyncService - : public ProfileSyncServiceBase, - public browser_sync::SyncFrontend, - public browser_sync::SyncPrefObserver, - public browser_sync::DataTypeManagerObserver, - public syncer::UnrecoverableErrorHandler, - public content::NotificationObserver, - public BrowserContextKeyedService, - public browser_sync::DataTypeEncryptionHandler, - public OAuth2TokenService::Consumer, - public OAuth2TokenService::Observer, - public SessionsSyncManager::SyncInternalApiDelegate { +class ProfileSyncService : public ProfileSyncServiceBase, + public browser_sync::SyncFrontend, + public browser_sync::SyncPrefObserver, + public browser_sync::DataTypeManagerObserver, + public syncer::UnrecoverableErrorHandler, + public content::NotificationObserver, + public KeyedService, + public browser_sync::DataTypeEncryptionHandler, + public OAuth2TokenService::Consumer, + public OAuth2TokenService::Observer, + public SessionsSyncManager::SyncInternalApiDelegate { public: typedef browser_sync::SyncBackendHost::Status Status; @@ -683,7 +682,7 @@ class ProfileSyncService virtual void OnRefreshTokenRevoked(const std::string& account_id) OVERRIDE; virtual void OnRefreshTokensLoaded() OVERRIDE; - // BrowserContextKeyedService implementation. This must be called exactly + // KeyedService implementation. This must be called exactly // once (before this object is destroyed). virtual void Shutdown() OVERRIDE; diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc index 03462a6..3792262 100644 --- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc @@ -338,8 +338,7 @@ class WebDataServiceFake : public AutofillWebDataService { DISALLOW_COPY_AND_ASSIGN(WebDataServiceFake); }; -BrowserContextKeyedService* BuildMockWebDataServiceWrapper( - content::BrowserContext* profile) { +KeyedService* BuildMockWebDataServiceWrapper(content::BrowserContext* profile) { return new MockWebDataServiceWrapper( NULL, new WebDataServiceFake(), @@ -453,7 +452,7 @@ class MockPersonalDataManager : public PersonalDataManager { class MockPersonalDataManagerService : public autofill::PersonalDataManagerService { public: - static BrowserContextKeyedService* Build(content::BrowserContext* profile) { + static KeyedService* Build(content::BrowserContext* profile) { return new MockPersonalDataManagerService(); } diff --git a/chrome/browser/sync/profile_sync_service_factory.cc b/chrome/browser/sync/profile_sync_service_factory.cc index 93c202a..4f965cf 100644 --- a/chrome/browser/sync/profile_sync_service_factory.cc +++ b/chrome/browser/sync/profile_sync_service_factory.cc @@ -31,7 +31,7 @@ #include "chrome/browser/ui/global_error/global_error_service_factory.h" #include "chrome/browser/webdata/web_data_service_factory.h" #include "chrome/common/pref_names.h" -#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "extensions/browser/extension_system_provider.h" #include "extensions/browser/extensions_browser_client.h" @@ -86,7 +86,7 @@ ProfileSyncServiceFactory::ProfileSyncServiceFactory() ProfileSyncServiceFactory::~ProfileSyncServiceFactory() { } -BrowserContextKeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( +KeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); diff --git a/chrome/browser/sync/profile_sync_service_factory.h b/chrome/browser/sync/profile_sync_service_factory.h index 0ad8c2a..89916ed 100644 --- a/chrome/browser/sync/profile_sync_service_factory.h +++ b/chrome/browser/sync/profile_sync_service_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" +#include "components/keyed_service/content/browser_context_keyed_service_factory.h" class Profile; class ProfileSyncService; @@ -26,7 +26,7 @@ class ProfileSyncServiceFactory : public BrowserContextKeyedServiceFactory { virtual ~ProfileSyncServiceFactory(); // BrowserContextKeyedServiceFactory: - virtual BrowserContextKeyedService* BuildServiceInstanceFor( + virtual KeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; }; diff --git a/chrome/browser/sync/profile_sync_service_mock.cc b/chrome/browser/sync/profile_sync_service_mock.cc index 333aa34..aeefd04 100644 --- a/chrome/browser/sync/profile_sync_service_mock.cc +++ b/chrome/browser/sync/profile_sync_service_mock.cc @@ -34,7 +34,7 @@ TestingProfile* ProfileSyncServiceMock::MakeSignedInTestingProfile() { } // static -BrowserContextKeyedService* ProfileSyncServiceMock::BuildMockProfileSyncService( +KeyedService* ProfileSyncServiceMock::BuildMockProfileSyncService( content::BrowserContext* profile) { return new ProfileSyncServiceMock(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/sync/profile_sync_service_mock.h b/chrome/browser/sync/profile_sync_service_mock.h index fa9c3f0..15eb0ee 100644 --- a/chrome/browser/sync/profile_sync_service_mock.h +++ b/chrome/browser/sync/profile_sync_service_mock.h @@ -33,7 +33,7 @@ class ProfileSyncServiceMock : public ProfileSyncService { // Helper routine to be used in conjunction with // BrowserContextKeyedServiceFactory::SetTestingFactory(). - static BrowserContextKeyedService* BuildMockProfileSyncService( + static KeyedService* BuildMockProfileSyncService( content::BrowserContext* profile); MOCK_METHOD0(DisableForUser, void()); diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc index d1a710f..9c8ce39 100644 --- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc @@ -90,8 +90,7 @@ class ProfileSyncServiceStartupTest : public testing::Test { profile_.reset(); } - static BrowserContextKeyedService* BuildService( - content::BrowserContext* browser_context) { + static KeyedService* BuildService(content::BrowserContext* browser_context) { Profile* profile = static_cast<Profile*>(browser_context); return new ProfileSyncService( new ProfileSyncComponentsFactoryMock(), @@ -151,8 +150,7 @@ class ProfileSyncServiceStartupCrosTest : public ProfileSyncServiceStartupTest { sync_->AddObserver(&observer_); } - static BrowserContextKeyedService* BuildCrosService( - content::BrowserContext* context) { + static KeyedService* BuildCrosService(content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile); 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 c8c988d..396f700 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -41,7 +41,7 @@ #include "chrome/browser/sync/profile_sync_test_util.h" #include "chrome/browser/sync/test_profile_sync_service.h" #include "chrome/test/base/testing_profile.h" -#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" +#include "components/keyed_service/content/refcounted_browser_context_keyed_service.h" #include "components/sync_driver/data_type_error_handler_mock.h" #include "content/public/browser/notification_service.h" #include "google_apis/gaia/gaia_constants.h" @@ -110,8 +110,7 @@ class HistoryServiceMock : public HistoryService { virtual ~HistoryServiceMock() {} }; -BrowserContextKeyedService* BuildHistoryService( - content::BrowserContext* profile) { +KeyedService* BuildHistoryService(content::BrowserContext* profile) { return new HistoryServiceMock(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/sync/sync_global_error_unittest.cc b/chrome/browser/sync/sync_global_error_unittest.cc index a1f06da..b35399e 100644 --- a/chrome/browser/sync/sync_global_error_unittest.cc +++ b/chrome/browser/sync/sync_global_error_unittest.cc @@ -51,8 +51,7 @@ class FakeLoginUI : public LoginUIService::LoginUI { int focus_ui_call_count_; }; -BrowserContextKeyedService* BuildMockLoginUIService( - content::BrowserContext* profile) { +KeyedService* BuildMockLoginUIService(content::BrowserContext* profile) { return new FakeLoginUIService(); } diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index 6f06c11..c540f7f 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -105,8 +105,7 @@ void SetProxyConfigCallback( done->Signal(); } -BrowserContextKeyedService* BuildP2PInvalidationService( - content::BrowserContext* context) { +KeyedService* BuildP2PInvalidationService(content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); return new invalidation::P2PInvalidationService(profile); } diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc index 6a92bff..3bdba1f 100644 --- a/chrome/browser/sync/test_profile_sync_service.cc +++ b/chrome/browser/sync/test_profile_sync_service.cc @@ -114,7 +114,7 @@ TestProfileSyncService::~TestProfileSyncService() { } // static -BrowserContextKeyedService* TestProfileSyncService::TestFactoryFunction( +KeyedService* TestProfileSyncService::TestFactoryFunction( content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); SigninManagerBase* signin = diff --git a/chrome/browser/sync/test_profile_sync_service.h b/chrome/browser/sync/test_profile_sync_service.h index d3c4102..fff476d 100644 --- a/chrome/browser/sync/test_profile_sync_service.h +++ b/chrome/browser/sync/test_profile_sync_service.h @@ -93,8 +93,7 @@ class TestProfileSyncService : public ProfileSyncService { syncer::TestIdFactory* id_factory(); protected: - static BrowserContextKeyedService* TestFactoryFunction( - content::BrowserContext* profile); + static KeyedService* TestFactoryFunction(content::BrowserContext* profile); // Return NULL handle to use in backend initialization to avoid receiving // js messages on UI loop when it's being destroyed, which are not deleted |