diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-22 23:25:44 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-22 23:25:44 +0000 |
commit | f1484c5242850142011c4db4572b9b742f6b56f5 (patch) | |
tree | 6cc51ae1fca2aea4a7f76ab9171a4247eff78a9f /chrome | |
parent | 59bf05a05ddf1bec2d2a4ad6d38a3338a41b7805 (diff) | |
download | chromium_src-f1484c5242850142011c4db4572b9b742f6b56f5.zip chromium_src-f1484c5242850142011c4db4572b9b742f6b56f5.tar.gz chromium_src-f1484c5242850142011c4db4572b9b742f6b56f5.tar.bz2 |
Remove references to Profile from browser_context_keyed_service.
BUG=227219
R=joi@chromium.org
Review URL: https://codereview.chromium.org/15517005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
347 files changed, 1253 insertions, 1086 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_classifier.h b/chrome/browser/autocomplete/autocomplete_classifier.h index d0bffe7..a5a7b10 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier.h +++ b/chrome/browser/autocomplete/autocomplete_classifier.h @@ -16,7 +16,7 @@ struct AutocompleteMatch; class GURL; class Profile; -class AutocompleteClassifier : public ProfileKeyedService { +class AutocompleteClassifier : public BrowserContextKeyedService { public: // Bitmap of AutocompleteProvider::Type values describing the default set of // providers queried for the omnibox. Intended to be passed to @@ -51,7 +51,7 @@ class AutocompleteClassifier : public ProfileKeyedService { GURL* alternate_nav_url); private: - // ProfileKeyedService: + // BrowserContextKeyedService: virtual void Shutdown() OVERRIDE; scoped_ptr<AutocompleteController> controller_; diff --git a/chrome/browser/autocomplete/autocomplete_classifier_factory.cc b/chrome/browser/autocomplete/autocomplete_classifier_factory.cc index df23f6bf..8cc0231 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier_factory.cc +++ b/chrome/browser/autocomplete/autocomplete_classifier_factory.cc @@ -17,7 +17,7 @@ AutocompleteClassifier* AutocompleteClassifierFactory::GetForProfile( Profile* profile) { return static_cast<AutocompleteClassifier*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -26,14 +26,15 @@ AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() { } // static -ProfileKeyedService* AutocompleteClassifierFactory::BuildInstanceFor( +BrowserContextKeyedService* AutocompleteClassifierFactory::BuildInstanceFor( content::BrowserContext* profile) { return new AutocompleteClassifier(static_cast<Profile*>(profile)); } AutocompleteClassifierFactory::AutocompleteClassifierFactory() - : ProfileKeyedServiceFactory("AutocompleteClassifier", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "AutocompleteClassifier", + BrowserContextDependencyManager::GetInstance()) { DependsOn(extensions::ExtensionSystemFactory::GetInstance()); DependsOn(TemplateURLServiceFactory::GetInstance()); // TODO(pkasting): Uncomment these once they exist. @@ -53,7 +54,8 @@ bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const { return true; } -ProfileKeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +AutocompleteClassifierFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return BuildInstanceFor(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/autocomplete/autocomplete_classifier_factory.h b/chrome/browser/autocomplete/autocomplete_classifier_factory.h index dcee47a..51d42c7 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier_factory.h +++ b/chrome/browser/autocomplete/autocomplete_classifier_factory.h @@ -14,14 +14,14 @@ class Profile; // Singleton that owns all AutocompleteClassifiers and associates them with // Profiles. -class AutocompleteClassifierFactory : public ProfileKeyedServiceFactory { +class AutocompleteClassifierFactory : public BrowserContextKeyedServiceFactory { public: // Returns the AutocompleteClassifier for |profile|. static AutocompleteClassifier* GetForProfile(Profile* profile); static AutocompleteClassifierFactory* GetInstance(); - static ProfileKeyedService* BuildInstanceFor( + static BrowserContextKeyedService* BuildInstanceFor( content::BrowserContext* profile); private: @@ -30,11 +30,11 @@ class AutocompleteClassifierFactory : public ProfileKeyedServiceFactory { AutocompleteClassifierFactory(); virtual ~AutocompleteClassifierFactory(); - // ProfileKeyedServiceFactory: + // BrowserContextKeyedServiceFactory: virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(AutocompleteClassifierFactory); diff --git a/chrome/browser/autocomplete/history_contents_provider_unittest.cc b/chrome/browser/autocomplete/history_contents_provider_unittest.cc index 6ed56f2..da15d1c 100644 --- a/chrome/browser/autocomplete/history_contents_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_contents_provider_unittest.cc @@ -67,7 +67,7 @@ class HistoryContentsProviderTest : public testing::Test, virtual bool BodyOnly() { return false; } private: - static ProfileKeyedService* CreateTemplateURLService( + static BrowserContextKeyedService* CreateTemplateURLService( content::BrowserContext* profile) { return new TemplateURLService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/autocomplete/history_quick_provider_unittest.cc b/chrome/browser/autocomplete/history_quick_provider_unittest.cc index 1630ab2..4ac113c 100644 --- a/chrome/browser/autocomplete/history_quick_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_quick_provider_unittest.cc @@ -111,7 +111,7 @@ class HistoryQuickProviderTest : public testing::Test, std::set<std::string> matches_; }; - static ProfileKeyedService* CreateTemplateURLService( + static BrowserContextKeyedService* CreateTemplateURLService( content::BrowserContext* profile) { return new TemplateURLService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc index f31660d..a4e49f40 100644 --- a/chrome/browser/autocomplete/history_url_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc @@ -147,7 +147,7 @@ class HistoryURLProviderTest : public testing::Test, virtual void OnProviderUpdate(bool updated_matches) OVERRIDE; protected: - static ProfileKeyedService* CreateTemplateURLService( + static BrowserContextKeyedService* CreateTemplateURLService( content::BrowserContext* profile) { return new TemplateURLService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc index 180bc8e..a38c9dc 100644 --- a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc +++ b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc @@ -51,7 +51,7 @@ WhitelistManager* WhitelistManagerFactory::GetForProfile(Profile* profile) { WhitelistManagerService* service = static_cast<WhitelistManagerService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); // service can be NULL for tests. return service ? service->GetWhitelistManager() : NULL; } @@ -63,14 +63,15 @@ WhitelistManagerFactory::GetInstance() { } WhitelistManagerFactory::WhitelistManagerFactory() - : ProfileKeyedServiceFactory("AutocheckoutWhitelistManager", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "AutocheckoutWhitelistManager", + BrowserContextDependencyManager::GetInstance()) { } WhitelistManagerFactory::~WhitelistManagerFactory() { } -ProfileKeyedService* +BrowserContextKeyedService* WhitelistManagerFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { WhitelistManagerService* service = diff --git a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h index 5b42fb1..7fa08da 100644 --- a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h +++ b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h @@ -19,7 +19,7 @@ class WhitelistManager; // A wrapper of WhitelistManager so we can use it as a profiled // keyed service. Exposed in header file only for tests. -class WhitelistManagerService : public ProfileKeyedService { +class WhitelistManagerService : public BrowserContextKeyedService { public: virtual WhitelistManager* GetWhitelistManager() = 0; }; @@ -28,7 +28,7 @@ class WhitelistManagerService : public ProfileKeyedService { // with Profiles. // Listens for the Profile's destruction notification and cleans up the // associated WhitelistManager. -class WhitelistManagerFactory : public ProfileKeyedServiceFactory { +class WhitelistManagerFactory : public BrowserContextKeyedServiceFactory { public: // Returns the WhitelistManager for |profile|, creating it if // it is not yet created. @@ -42,8 +42,8 @@ class WhitelistManagerFactory : public ProfileKeyedServiceFactory { WhitelistManagerFactory(); virtual ~WhitelistManagerFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/autofill/personal_data_manager_factory.cc b/chrome/browser/autofill/personal_data_manager_factory.cc index c688f54..5157fe2 100644 --- a/chrome/browser/autofill/personal_data_manager_factory.cc +++ b/chrome/browser/autofill/personal_data_manager_factory.cc @@ -53,7 +53,7 @@ PersonalDataManager* PersonalDataManagerFactory::GetForProfile( Profile* profile) { PersonalDataManagerService* service = static_cast<PersonalDataManagerService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); if (service) return service->GetPersonalDataManager(); @@ -68,15 +68,16 @@ PersonalDataManagerFactory* PersonalDataManagerFactory::GetInstance() { } PersonalDataManagerFactory::PersonalDataManagerFactory() - : ProfileKeyedServiceFactory("PersonalDataManager", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "PersonalDataManager", + BrowserContextDependencyManager::GetInstance()) { DependsOn(WebDataServiceFactory::GetInstance()); } PersonalDataManagerFactory::~PersonalDataManagerFactory() { } -ProfileKeyedService* PersonalDataManagerFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* PersonalDataManagerFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { PersonalDataManagerService* service = new PersonalDataManagerServiceImpl(static_cast<Profile*>(profile)); diff --git a/chrome/browser/autofill/personal_data_manager_factory.h b/chrome/browser/autofill/personal_data_manager_factory.h index 881eb53..fdff9e1 100644 --- a/chrome/browser/autofill/personal_data_manager_factory.h +++ b/chrome/browser/autofill/personal_data_manager_factory.h @@ -19,7 +19,7 @@ class PersonalDataManager; // A wrapper of PersonalDataManager so we can use it as a profiled keyed // service. This should only be subclassed in tests, e.g. to provide a mock // PersonalDataManager. -class PersonalDataManagerService : public ProfileKeyedService { +class PersonalDataManagerService : public BrowserContextKeyedService { public: virtual PersonalDataManager* GetPersonalDataManager() = 0; }; @@ -28,7 +28,7 @@ class PersonalDataManagerService : public ProfileKeyedService { // Profiles. // Listens for the Profile's destruction notification and cleans up the // associated PersonalDataManager. -class PersonalDataManagerFactory : public ProfileKeyedServiceFactory { +class PersonalDataManagerFactory : public BrowserContextKeyedServiceFactory { public: // Returns the PersonalDataManager for |profile|, creating it if it is not // yet created. @@ -42,8 +42,8 @@ class PersonalDataManagerFactory : public ProfileKeyedServiceFactory { PersonalDataManagerFactory(); virtual ~PersonalDataManagerFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/background/background_contents_service.h b/chrome/browser/background/background_contents_service.h index 5b5f2e3..3cddb7d 100644 --- a/chrome/browser/background/background_contents_service.h +++ b/chrome/browser/background/background_contents_service.h @@ -43,7 +43,7 @@ struct BackgroundContentsOpenedDetails; // parent app is unloaded. class BackgroundContentsService : private content::NotificationObserver, public BackgroundContents::Delegate, - public ProfileKeyedService { + public BrowserContextKeyedService { public: BackgroundContentsService(Profile* profile, const CommandLine* command_line); virtual ~BackgroundContentsService(); diff --git a/chrome/browser/background/background_contents_service_factory.cc b/chrome/browser/background/background_contents_service_factory.cc index 44287bc..674c3c1 100644 --- a/chrome/browser/background/background_contents_service_factory.cc +++ b/chrome/browser/background/background_contents_service_factory.cc @@ -17,7 +17,7 @@ BackgroundContentsService* BackgroundContentsServiceFactory::GetForProfile( Profile* profile) { return static_cast<BackgroundContentsService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -27,14 +27,16 @@ BackgroundContentsServiceFactory* BackgroundContentsServiceFactory:: } BackgroundContentsServiceFactory::BackgroundContentsServiceFactory() - : ProfileKeyedServiceFactory("BackgroundContentsService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "BackgroundContentsService", + BrowserContextDependencyManager::GetInstance()) { } BackgroundContentsServiceFactory::~BackgroundContentsServiceFactory() { } -ProfileKeyedService* BackgroundContentsServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +BackgroundContentsServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new BackgroundContentsService(static_cast<Profile*>(profile), CommandLine::ForCurrentProcess()); @@ -53,7 +55,8 @@ BackgroundContentsServiceFactory::GetBrowserContextToUse( return chrome::GetBrowserContextOwnInstanceInIncognito(context); } -bool BackgroundContentsServiceFactory::ServiceIsCreatedWithProfile() const { +bool +BackgroundContentsServiceFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/background/background_contents_service_factory.h b/chrome/browser/background/background_contents_service_factory.h index f99edbf..6b40c8a 100644 --- a/chrome/browser/background/background_contents_service_factory.h +++ b/chrome/browser/background/background_contents_service_factory.h @@ -15,7 +15,8 @@ class Profile; // Singleton that owns all BackgroundContentsServices and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated BackgroundContentsService. -class BackgroundContentsServiceFactory : public ProfileKeyedServiceFactory { +class BackgroundContentsServiceFactory + : public BrowserContextKeyedServiceFactory { public: static BackgroundContentsService* GetForProfile(Profile* profile); @@ -27,14 +28,14 @@ class BackgroundContentsServiceFactory : public ProfileKeyedServiceFactory { BackgroundContentsServiceFactory(); virtual ~BackgroundContentsServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/background/background_contents_service_unittest.cc b/chrome/browser/background/background_contents_service_unittest.cc index 6964c11..f05216c 100644 --- a/chrome/browser/background/background_contents_service_unittest.cc +++ b/chrome/browser/background/background_contents_service_unittest.cc @@ -124,8 +124,8 @@ TEST_F(BackgroundContentsServiceTest, BackgroundContentsCreateDestroy) { TEST_F(BackgroundContentsServiceTest, BackgroundContentsUrlAdded) { TestingProfile profile; BackgroundContentsService service(&profile, command_line_.get()); - BackgroundContentsServiceFactory::GetInstance()->RegisterUserPrefsOnProfile( - &profile); + BackgroundContentsServiceFactory::GetInstance()-> + RegisterUserPrefsOnBrowserContext(&profile); GURL orig_url; GURL url("http://a/"); GURL url2("http://a/"); @@ -151,8 +151,8 @@ TEST_F(BackgroundContentsServiceTest, BackgroundContentsUrlAdded) { TEST_F(BackgroundContentsServiceTest, BackgroundContentsUrlAddedAndClosed) { TestingProfile profile; BackgroundContentsService service(&profile, command_line_.get()); - BackgroundContentsServiceFactory::GetInstance()->RegisterUserPrefsOnProfile( - &profile); + BackgroundContentsServiceFactory::GetInstance()-> + RegisterUserPrefsOnBrowserContext(&profile); GURL url("http://a/"); MockBackgroundContents* contents = new MockBackgroundContents(&profile); @@ -172,8 +172,8 @@ TEST_F(BackgroundContentsServiceTest, BackgroundContentsUrlAddedAndClosed) { TEST_F(BackgroundContentsServiceTest, RestartBackgroundContents) { TestingProfile profile; BackgroundContentsService service(&profile, command_line_.get()); - BackgroundContentsServiceFactory::GetInstance()->RegisterUserPrefsOnProfile( - &profile); + BackgroundContentsServiceFactory::GetInstance()-> + RegisterUserPrefsOnBrowserContext(&profile); GURL url("http://a/"); { @@ -204,8 +204,8 @@ TEST_F(BackgroundContentsServiceTest, RestartBackgroundContents) { TEST_F(BackgroundContentsServiceTest, TestApplicationIDLinkage) { TestingProfile profile; BackgroundContentsService service(&profile, command_line_.get()); - BackgroundContentsServiceFactory::GetInstance()->RegisterUserPrefsOnProfile( - &profile); + BackgroundContentsServiceFactory::GetInstance()-> + RegisterUserPrefsOnBrowserContext(&profile); EXPECT_EQ(NULL, service.GetAppBackgroundContents(ASCIIToUTF16("appid"))); MockBackgroundContents* contents = new MockBackgroundContents(&profile, diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index 736cf08..7205561 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -230,7 +230,7 @@ class BookmarkPermanentNode : public BookmarkNode { // BookmarkModelFactory. class BookmarkModel : public content::NotificationObserver, public BookmarkService, - public ProfileKeyedService { + public BrowserContextKeyedService { public: explicit BookmarkModel(Profile* profile); virtual ~BookmarkModel(); diff --git a/chrome/browser/bookmarks/bookmark_model_factory.cc b/chrome/browser/bookmarks/bookmark_model_factory.cc index dd2c637..d81df62 100644 --- a/chrome/browser/bookmarks/bookmark_model_factory.cc +++ b/chrome/browser/bookmarks/bookmark_model_factory.cc @@ -19,12 +19,12 @@ // static BookmarkModel* BookmarkModelFactory::GetForProfile(Profile* profile) { return static_cast<BookmarkModel*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } BookmarkModel* BookmarkModelFactory::GetForProfileIfExists(Profile* profile) { return static_cast<BookmarkModel*>( - GetInstance()->GetServiceForProfile(profile, false)); + GetInstance()->GetServiceForBrowserContext(profile, false)); } // static @@ -33,13 +33,14 @@ BookmarkModelFactory* BookmarkModelFactory::GetInstance() { } BookmarkModelFactory::BookmarkModelFactory() - : ProfileKeyedServiceFactory("BookmarkModel", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "BookmarkModel", + BrowserContextDependencyManager::GetInstance()) { } BookmarkModelFactory::~BookmarkModelFactory() {} -ProfileKeyedService* BookmarkModelFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* BookmarkModelFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); BookmarkModel* bookmark_model = new BookmarkModel(profile); diff --git a/chrome/browser/bookmarks/bookmark_model_factory.h b/chrome/browser/bookmarks/bookmark_model_factory.h index 2ad76a4..0975c14a 100644 --- a/chrome/browser/bookmarks/bookmark_model_factory.h +++ b/chrome/browser/bookmarks/bookmark_model_factory.h @@ -15,7 +15,7 @@ class Profile; class BookmarkModel; // Singleton that owns all BookmarkModel and associates them with Profiles. -class BookmarkModelFactory : public ProfileKeyedServiceFactory { +class BookmarkModelFactory : public BrowserContextKeyedServiceFactory { public: static BookmarkModel* GetForProfile(Profile* profile); @@ -29,8 +29,8 @@ class BookmarkModelFactory : public ProfileKeyedServiceFactory { BookmarkModelFactory(); virtual ~BookmarkModelFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; diff --git a/chrome/browser/captive_portal/captive_portal_service.h b/chrome/browser/captive_portal/captive_portal_service.h index 02c989e..f9c5b4a 100644 --- a/chrome/browser/captive_portal/captive_portal_service.h +++ b/chrome/browser/captive_portal/captive_portal_service.h @@ -27,7 +27,7 @@ namespace captive_portal { // Captive portal checks are rate-limited. The CaptivePortalService may only // be accessed on the UI thread. // Design doc: https://docs.google.com/document/d/1k-gP2sswzYNvryu9NcgN7q5XrsMlUdlUdoW9WRaEmfM/edit -class CaptivePortalService : public ProfileKeyedService, +class CaptivePortalService : public BrowserContextKeyedService, public base::NonThreadSafe { public: enum TestingState { @@ -114,7 +114,7 @@ class CaptivePortalService : public ProfileKeyedService, void OnPortalDetectionCompleted( const CaptivePortalDetector::Results& results); - // ProfileKeyedService: + // BrowserContextKeyedService: virtual void Shutdown() OVERRIDE; // Called when a captive portal check completes. Passes the result to all diff --git a/chrome/browser/captive_portal/captive_portal_service_factory.cc b/chrome/browser/captive_portal/captive_portal_service_factory.cc index c677e72..53b4483 100644 --- a/chrome/browser/captive_portal/captive_portal_service_factory.cc +++ b/chrome/browser/captive_portal/captive_portal_service_factory.cc @@ -15,7 +15,7 @@ namespace captive_portal { CaptivePortalService* CaptivePortalServiceFactory::GetForProfile( Profile* profile) { return static_cast<CaptivePortalService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -24,14 +24,16 @@ CaptivePortalServiceFactory* CaptivePortalServiceFactory::GetInstance() { } CaptivePortalServiceFactory::CaptivePortalServiceFactory() - : ProfileKeyedServiceFactory("CaptivePortalService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "CaptivePortalService", + BrowserContextDependencyManager::GetInstance()) { } CaptivePortalServiceFactory::~CaptivePortalServiceFactory() { } -ProfileKeyedService* CaptivePortalServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +CaptivePortalServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new CaptivePortalService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/captive_portal/captive_portal_service_factory.h b/chrome/browser/captive_portal/captive_portal_service_factory.h index 4838d3d..8a60bfe 100644 --- a/chrome/browser/captive_portal/captive_portal_service_factory.h +++ b/chrome/browser/captive_portal/captive_portal_service_factory.h @@ -20,7 +20,7 @@ class CaptivePortalService; // Profiles. Listens for the Profile's destruction notification and cleans up // the associated CaptivePortalService. Incognito profiles have their own // CaptivePortalService. -class CaptivePortalServiceFactory : public ProfileKeyedServiceFactory { +class CaptivePortalServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the CaptivePortalService for |profile|. static CaptivePortalService* GetForProfile(Profile* profile); @@ -35,8 +35,8 @@ class CaptivePortalServiceFactory : public ProfileKeyedServiceFactory { CaptivePortalServiceFactory(); virtual ~CaptivePortalServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 4fb44533..c249c89 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -1492,7 +1492,8 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // the service process if needed. This is needed because the service process // might have shutdown because an update was available. // TODO(torne): this should maybe be done with - // ProfileKeyedServiceFactory::ServiceIsCreatedWithProfile() instead? + // BrowserContextKeyedServiceFactory::ServiceIsCreatedWithBrowserContext() + // instead? #if !defined(OS_ANDROID) CloudPrintProxyServiceFactory::GetForProfile(profile_); #endif diff --git a/chrome/browser/chrome_to_mobile_service.h b/chrome/browser/chrome_to_mobile_service.h index 22a4b4a..90c6d2e 100644 --- a/chrome/browser/chrome_to_mobile_service.h +++ b/chrome/browser/chrome_to_mobile_service.h @@ -43,7 +43,7 @@ class PrefRegistrySyncable; // ChromeToMobileService connects to the cloud print service to enumerate // compatible mobiles owned by its profile and send URLs and MHTML snapshots. -class ChromeToMobileService : public ProfileKeyedService, +class ChromeToMobileService : public BrowserContextKeyedService, public net::URLFetcherDelegate, public content::NotificationObserver, public OAuth2AccessTokenConsumer, @@ -134,7 +134,7 @@ class ChromeToMobileService : public ProfileKeyedService, // Opens the "Learn More" help article link in the supplied |browser|. void LearnMore(Browser* browser) const; - // ProfileKeyedService method. + // BrowserContextKeyedService method. virtual void Shutdown() OVERRIDE; // net::URLFetcherDelegate method. diff --git a/chrome/browser/chrome_to_mobile_service_factory.cc b/chrome/browser/chrome_to_mobile_service_factory.cc index a467ca2..3c1150a 100644 --- a/chrome/browser/chrome_to_mobile_service_factory.cc +++ b/chrome/browser/chrome_to_mobile_service_factory.cc @@ -19,10 +19,11 @@ ChromeToMobileServiceFactory* ChromeToMobileServiceFactory::GetInstance() { ChromeToMobileService* ChromeToMobileServiceFactory::GetForProfile( Profile* profile) { return static_cast<ChromeToMobileService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } -ProfileKeyedService* ChromeToMobileServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +ChromeToMobileServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { // Ensure that the service is not instantiated or used if it is disabled. if (!ChromeToMobileService::IsChromeToMobileEnabled()) @@ -32,8 +33,9 @@ ProfileKeyedService* ChromeToMobileServiceFactory::BuildServiceInstanceFor( } ChromeToMobileServiceFactory::ChromeToMobileServiceFactory() - : ProfileKeyedServiceFactory("ChromeToMobileService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ChromeToMobileService", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ProfileSyncServiceFactory::GetInstance()); DependsOn(TokenServiceFactory::GetInstance()); // TODO(msw): Uncomment this once it exists. diff --git a/chrome/browser/chrome_to_mobile_service_factory.h b/chrome/browser/chrome_to_mobile_service_factory.h index 7a128a4..da2ee63 100644 --- a/chrome/browser/chrome_to_mobile_service_factory.h +++ b/chrome/browser/chrome_to_mobile_service_factory.h @@ -12,7 +12,7 @@ class ChromeToMobileService; class Profile; -class ChromeToMobileServiceFactory : public ProfileKeyedServiceFactory { +class ChromeToMobileServiceFactory : public BrowserContextKeyedServiceFactory { public: // Get the singleton ChromeToMobileServiceFactory instance. static ChromeToMobileServiceFactory* GetInstance(); @@ -21,8 +21,8 @@ class ChromeToMobileServiceFactory : public ProfileKeyedServiceFactory { static ChromeToMobileService* GetForProfile(Profile* profile); protected: - // ProfileKeyedServiceFactory overrides: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory overrides: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; private: diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc index 1f9424d..0b789f9 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc @@ -64,8 +64,9 @@ void KioskAppUpdateService::ForceRestart() { } KioskAppUpdateServiceFactory::KioskAppUpdateServiceFactory() - : ProfileKeyedServiceFactory("KioskAppUpdateService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "KioskAppUpdateService", + BrowserContextDependencyManager::GetInstance()) { DependsOn(extensions::ExtensionSystemFactory::GetInstance()); } @@ -81,7 +82,7 @@ KioskAppUpdateService* KioskAppUpdateServiceFactory::GetForProfile( return NULL; return static_cast<KioskAppUpdateService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -89,7 +90,8 @@ KioskAppUpdateServiceFactory* KioskAppUpdateServiceFactory::GetInstance() { return Singleton<KioskAppUpdateServiceFactory>::get(); } -ProfileKeyedService* KioskAppUpdateServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +KioskAppUpdateServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new KioskAppUpdateService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h index 1fd9dd1..7421a81 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h +++ b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h @@ -20,7 +20,7 @@ class Profile; namespace chromeos { // This class enforces automatic restart on app and Chrome updates in app mode. -class KioskAppUpdateService : public ProfileKeyedService, +class KioskAppUpdateService : public BrowserContextKeyedService, public extensions::UpdateObserver { public: explicit KioskAppUpdateService(Profile* profile); @@ -37,7 +37,7 @@ class KioskAppUpdateService : public ProfileKeyedService, virtual void OnAppUpdateAvailable(const std::string& app_id) OVERRIDE; virtual void OnChromeUpdateAvailable() OVERRIDE {} - // ProfileKeyedService overrides: + // BrowserContextKeyedService overrides: virtual void Shutdown() OVERRIDE; private: @@ -52,7 +52,7 @@ class KioskAppUpdateService : public ProfileKeyedService, // Singleton that owns all KioskAppUpdateServices and associates them with // profiles. -class KioskAppUpdateServiceFactory: public ProfileKeyedServiceFactory { +class KioskAppUpdateServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the KioskAppUpdateService for |profile|, creating it if it is not // yet created. @@ -67,8 +67,8 @@ class KioskAppUpdateServiceFactory: public ProfileKeyedServiceFactory { KioskAppUpdateServiceFactory(); virtual ~KioskAppUpdateServiceFactory(); - // ProfileKeyedServiceFactory overrides: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory overrides: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/chromeos/drive/drive_integration_service.cc b/chrome/browser/chromeos/drive/drive_integration_service.cc index 8257a2a..3815fa9 100644 --- a/chrome/browser/chromeos/drive/drive_integration_service.cc +++ b/chrome/browser/chromeos/drive/drive_integration_service.cc @@ -377,7 +377,7 @@ DriveIntegrationService* DriveIntegrationServiceFactory::GetForProfileRegardlessOfStates( Profile* profile) { return static_cast<DriveIntegrationService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -395,7 +395,7 @@ DriveIntegrationService* DriveIntegrationServiceFactory::FindForProfileRegardlessOfStates( Profile* profile) { return static_cast<DriveIntegrationService*>( - GetInstance()->GetServiceForProfile(profile, false)); + GetInstance()->GetServiceForBrowserContext(profile, false)); } // static @@ -410,8 +410,9 @@ void DriveIntegrationServiceFactory::SetFactoryForTest( } DriveIntegrationServiceFactory::DriveIntegrationServiceFactory() - : ProfileKeyedServiceFactory("DriveIntegrationService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "DriveIntegrationService", + BrowserContextDependencyManager::GetInstance()) { DependsOn(google_apis::DriveNotificationManagerFactory::GetInstance()); DependsOn(DownloadServiceFactory::GetInstance()); } @@ -419,7 +420,8 @@ DriveIntegrationServiceFactory::DriveIntegrationServiceFactory() DriveIntegrationServiceFactory::~DriveIntegrationServiceFactory() { } -ProfileKeyedService* DriveIntegrationServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +DriveIntegrationServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); diff --git a/chrome/browser/chromeos/drive/drive_integration_service.h b/chrome/browser/chromeos/drive/drive_integration_service.h index f8403d7..41a85af 100644 --- a/chrome/browser/chromeos/drive/drive_integration_service.h +++ b/chrome/browser/chromeos/drive/drive_integration_service.h @@ -69,7 +69,7 @@ class DriveIntegrationServiceObserver { // that are used to integrate Drive to Chrome. The object of this class is // created per-profile. class DriveIntegrationService - : public ProfileKeyedService, + : public BrowserContextKeyedService, public google_apis::DriveNotificationObserver { public: // test_drive_service, test_cache_root and test_file_system are used by tests @@ -86,7 +86,7 @@ class DriveIntegrationService // other functions. void Initialize(); - // ProfileKeyedService override: + // BrowserContextKeyedService override: virtual void Shutdown() OVERRIDE; // Adds and removes the observer. @@ -178,7 +178,8 @@ class DriveIntegrationService // Singleton that owns all instances of DriveIntegrationService and // associates them with Profiles. -class DriveIntegrationServiceFactory : public ProfileKeyedServiceFactory { +class DriveIntegrationServiceFactory + : public BrowserContextKeyedServiceFactory { public: // Factory function used by tests. typedef base::Callback<DriveIntegrationService*(Profile* profile)> @@ -222,8 +223,8 @@ class DriveIntegrationServiceFactory : public ProfileKeyedServiceFactory { DriveIntegrationServiceFactory(); virtual ~DriveIntegrationServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; FactoryCallback factory_for_test_; diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.h b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.h index 8e2a910..89f2772 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.h +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.h @@ -46,12 +46,12 @@ struct SelectedFileInfo; } // Manages and registers the fileBrowserPrivate API with the extension system. -class FileBrowserPrivateAPI : public ProfileKeyedService { +class FileBrowserPrivateAPI : public BrowserContextKeyedService { public: explicit FileBrowserPrivateAPI(Profile* profile); virtual ~FileBrowserPrivateAPI(); - // ProfileKeyedService overrides. + // BrowserContextKeyedService overrides. virtual void Shutdown() OVERRIDE; // Convenience function to return the FileBrowserPrivateAPI for a Profile. diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc index e257fc0..9ef09ed 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc @@ -15,7 +15,7 @@ FileBrowserPrivateAPI* FileBrowserPrivateAPIFactory::GetForProfile(Profile* profile) { return static_cast<FileBrowserPrivateAPI*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -25,9 +25,9 @@ FileBrowserPrivateAPIFactory::GetInstance() { } FileBrowserPrivateAPIFactory::FileBrowserPrivateAPIFactory() - : ProfileKeyedServiceFactory( + : BrowserContextKeyedServiceFactory( "FileBrowserPrivateAPI", - ProfileDependencyManager::GetInstance()) { + BrowserContextDependencyManager::GetInstance()) { DependsOn(drive::DriveIntegrationServiceFactory::GetInstance()); DependsOn(extensions::ExtensionSystemFactory::GetInstance()); } @@ -35,7 +35,8 @@ FileBrowserPrivateAPIFactory::FileBrowserPrivateAPIFactory() FileBrowserPrivateAPIFactory::~FileBrowserPrivateAPIFactory() { } -ProfileKeyedService* FileBrowserPrivateAPIFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +FileBrowserPrivateAPIFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new FileBrowserPrivateAPI(static_cast<Profile*>(profile)); } @@ -46,7 +47,7 @@ content::BrowserContext* FileBrowserPrivateAPIFactory::GetBrowserContextToUse( return chrome::GetBrowserContextOwnInstanceInIncognito(context); } -bool FileBrowserPrivateAPIFactory::ServiceIsCreatedWithProfile() const { +bool FileBrowserPrivateAPIFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h index 1fb3345..9f3d703 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h @@ -11,7 +11,7 @@ class FileBrowserPrivateAPI; class Profile; -class FileBrowserPrivateAPIFactory : public ProfileKeyedServiceFactory { +class FileBrowserPrivateAPIFactory : public BrowserContextKeyedServiceFactory { public: // Returns the FileBrowserPrivateAPI for |profile|, creating it if // it is not yet created. @@ -21,10 +21,10 @@ class FileBrowserPrivateAPIFactory : public ProfileKeyedServiceFactory { static FileBrowserPrivateAPIFactory* GetInstance(); protected: - // ProfileKeyedBaseFactory overrides: + // BrowserContextKeyedBaseFactory overrides: virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; private: @@ -33,8 +33,8 @@ class FileBrowserPrivateAPIFactory : public ProfileKeyedServiceFactory { FileBrowserPrivateAPIFactory(); virtual ~FileBrowserPrivateAPIFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/chromeos/extensions/install_limiter.h b/chrome/browser/chromeos/extensions/install_limiter.h index a72093f..c0fff26 100644 --- a/chrome/browser/chromeos/extensions/install_limiter.h +++ b/chrome/browser/chromeos/extensions/install_limiter.h @@ -24,7 +24,7 @@ namespace extensions { // InstallLimiter defers big app installs after all small app installs and then // runs big app installs one by one. This improves first-time login experience. // See http://crbug.com/166296 -class InstallLimiter : public ProfileKeyedService, +class InstallLimiter : public BrowserContextKeyedService, public content::NotificationObserver, public base::SupportsWeakPtr<InstallLimiter> { public: diff --git a/chrome/browser/chromeos/extensions/install_limiter_factory.cc b/chrome/browser/chromeos/extensions/install_limiter_factory.cc index bea0eca..222c738 100644 --- a/chrome/browser/chromeos/extensions/install_limiter_factory.cc +++ b/chrome/browser/chromeos/extensions/install_limiter_factory.cc @@ -14,7 +14,7 @@ namespace extensions { // static InstallLimiter* InstallLimiterFactory::GetForProfile(Profile* profile) { return static_cast<InstallLimiter*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -23,15 +23,16 @@ InstallLimiterFactory* InstallLimiterFactory::GetInstance() { } InstallLimiterFactory::InstallLimiterFactory() - : ProfileKeyedServiceFactory("InstallLimiter", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "InstallLimiter", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionSystemFactory::GetInstance()); } InstallLimiterFactory::~InstallLimiterFactory() { } -ProfileKeyedService* InstallLimiterFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* InstallLimiterFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new InstallLimiter(); } diff --git a/chrome/browser/chromeos/extensions/install_limiter_factory.h b/chrome/browser/chromeos/extensions/install_limiter_factory.h index 615a32c..8fe950f 100644 --- a/chrome/browser/chromeos/extensions/install_limiter_factory.h +++ b/chrome/browser/chromeos/extensions/install_limiter_factory.h @@ -17,7 +17,7 @@ namespace extensions { class InstallLimiter; // Singleton that owns all InstallLimiter and associates them with profiles. -class InstallLimiterFactory : public ProfileKeyedServiceFactory { +class InstallLimiterFactory : public BrowserContextKeyedServiceFactory { public: static InstallLimiter* GetForProfile(Profile* profile); @@ -29,8 +29,8 @@ class InstallLimiterFactory : public ProfileKeyedServiceFactory { InstallLimiterFactory(); virtual ~InstallLimiterFactory(); - // ProfileKeyedServiceFactory overrides: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory overrides: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(InstallLimiterFactory); diff --git a/chrome/browser/chromeos/extensions/networking_private_event_router.h b/chrome/browser/chromeos/extensions/networking_private_event_router.h index 40b9353..9173c76 100644 --- a/chrome/browser/chromeos/extensions/networking_private_event_router.h +++ b/chrome/browser/chromeos/extensions/networking_private_event_router.h @@ -13,10 +13,10 @@ class Profile; namespace chromeos { -// This is a factory class used by the ProfileDependencyManager to instantiate -// the event router that will forward events from the NetworkStateHandler to the -// JavaScript Networking API. -class NetworkingPrivateEventRouter : public ProfileKeyedService, +// This is a factory class used by the BrowserContextDependencyManager +// to instantiate the event router that will forward events +// from the NetworkStateHandler to the JavaScript Networking API. +class NetworkingPrivateEventRouter : public BrowserContextKeyedService, public extensions::EventRouter::Observer, public NetworkStateHandlerObserver { public: @@ -24,7 +24,7 @@ class NetworkingPrivateEventRouter : public ProfileKeyedService, virtual ~NetworkingPrivateEventRouter(); protected: - // ProfileKeyedService overrides: + // BrowserContextKeyedService overrides: virtual void Shutdown() OVERRIDE; // EventRouter::Observer overrides: diff --git a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc index 993a448..1a88b74 100644 --- a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc +++ b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc @@ -16,7 +16,7 @@ namespace chromeos { NetworkingPrivateEventRouter* NetworkingPrivateEventRouterFactory::GetForProfile(Profile* profile) { return static_cast<NetworkingPrivateEventRouter*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -26,16 +26,16 @@ NetworkingPrivateEventRouterFactory::GetInstance() { } NetworkingPrivateEventRouterFactory::NetworkingPrivateEventRouterFactory() - : ProfileKeyedServiceFactory( + : BrowserContextKeyedServiceFactory( "NetworkingPrivateEventRouter", - ProfileDependencyManager::GetInstance()) { + BrowserContextDependencyManager::GetInstance()) { DependsOn(extensions::ExtensionSystemFactory::GetInstance()); } NetworkingPrivateEventRouterFactory::~NetworkingPrivateEventRouterFactory() { } -ProfileKeyedService* +BrowserContextKeyedService* NetworkingPrivateEventRouterFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new NetworkingPrivateEventRouter(static_cast<Profile*>(profile)); @@ -47,7 +47,8 @@ NetworkingPrivateEventRouterFactory::GetBrowserContextToUse( return chrome::GetBrowserContextOwnInstanceInIncognito(context); } -bool NetworkingPrivateEventRouterFactory::ServiceIsCreatedWithProfile() const { +bool NetworkingPrivateEventRouterFactory:: +ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h index 93eba04..0208904 100644 --- a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h +++ b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h @@ -14,10 +14,11 @@ namespace chromeos { class NetworkingPrivateEventRouter; -// This is a factory class used by the ProfileDependencyManager to instantiate -// the networking event router per profile (since the extension event router is -// per profile). -class NetworkingPrivateEventRouterFactory : public ProfileKeyedServiceFactory { +// This is a factory class used by the BrowserContextDependencyManager +// to instantiate the networking event router per profile (since the extension +// event router is per profile). +class NetworkingPrivateEventRouterFactory + : public BrowserContextKeyedServiceFactory { public: // Returns the NetworkingPrivateEventRouter for |profile|, creating it if // it is not yet created. @@ -27,10 +28,10 @@ class NetworkingPrivateEventRouterFactory : public ProfileKeyedServiceFactory { static NetworkingPrivateEventRouterFactory* GetInstance(); protected: - // ProfileKeyedBaseFactory overrides: + // BrowserContextKeyedBaseFactory overrides: virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; private: @@ -39,8 +40,8 @@ class NetworkingPrivateEventRouterFactory : public ProfileKeyedServiceFactory { NetworkingPrivateEventRouterFactory(); virtual ~NetworkingPrivateEventRouterFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateEventRouterFactory); diff --git a/chrome/browser/chromeos/login/login_utils_browsertest.cc b/chrome/browser/chromeos/login/login_utils_browsertest.cc index 41462ad..568debe 100644 --- a/chrome/browser/chromeos/login/login_utils_browsertest.cc +++ b/chrome/browser/chromeos/login/login_utils_browsertest.cc @@ -409,7 +409,7 @@ class LoginUtilsTest : public testing::Test, // Normally this would happen during browser startup, but for tests // we need to trigger creation of Profile-related services. ChromeBrowserMainExtraPartsProfiles:: - EnsureProfileKeyedServiceFactoriesBuilt(); + EnsureBrowserContextKeyedServiceFactoriesBuilt(); DeviceSettingsTestHelper device_settings_test_helper; DeviceSettingsService::Get()->SetSessionManager( diff --git a/chrome/browser/chromeos/login/oauth2_login_manager.cc b/chrome/browser/chromeos/login/oauth2_login_manager.cc index bc14b57..993936a 100644 --- a/chrome/browser/chromeos/login/oauth2_login_manager.cc +++ b/chrome/browser/chromeos/login/oauth2_login_manager.cc @@ -54,8 +54,8 @@ void OAuth2LoginManager::RestoreSession( const std::string& oauth2_refresh_token, const std::string& auth_code) { // TODO(nkostylev): OAuth2LoginManager should support multi-profiles or - // should be refactored as ProfileKeyedService. For now we unsubscribe from - // TokenService notifications of a user that was previously active. + // should be refactored as BrowserContextKeyedService. For now we unsubscribe + // from TokenService notifications of a user that was previously active. // http://crbug.com/230342 registrar_.RemoveAll(); user_profile_ = user_profile; diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h index 142ac62..d9dad5f 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h @@ -38,7 +38,7 @@ class UserCloudPolicyManagerChromeOS public CloudPolicyClient::Observer, public CloudPolicyService::Observer, public ComponentCloudPolicyService::Delegate, - public ProfileKeyedService { + public BrowserContextKeyedService { public: // If |wait_for_policy_fetch| is true, IsInitializationComplete() will return // false as long as there hasn't been a successful policy fetch. diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc index 603c558..0cb76cc 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc @@ -66,8 +66,9 @@ scoped_ptr<UserCloudPolicyManagerChromeOS> } UserCloudPolicyManagerFactoryChromeOS::UserCloudPolicyManagerFactoryChromeOS() - : ProfileKeyedBaseFactory("UserCloudPolicyManagerChromeOS", - ProfileDependencyManager::GetInstance()) {} + : BrowserContextKeyedBaseFactory( + "UserCloudPolicyManagerChromeOS", + BrowserContextDependencyManager::GetInstance()) {} UserCloudPolicyManagerFactoryChromeOS:: ~UserCloudPolicyManagerFactoryChromeOS() {} @@ -156,7 +157,7 @@ scoped_ptr<UserCloudPolicyManagerChromeOS> return manager.Pass(); } -void UserCloudPolicyManagerFactoryChromeOS::ProfileShutdown( +void UserCloudPolicyManagerFactoryChromeOS::BrowserContextShutdown( content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); if (profile->IsOffTheRecord()) @@ -166,11 +167,11 @@ void UserCloudPolicyManagerFactoryChromeOS::ProfileShutdown( manager->Shutdown(); } -void UserCloudPolicyManagerFactoryChromeOS::ProfileDestroyed( +void UserCloudPolicyManagerFactoryChromeOS::BrowserContextDestroyed( content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); managers_.erase(profile); - ProfileKeyedBaseFactory::ProfileDestroyed(context); + BrowserContextKeyedBaseFactory::BrowserContextDestroyed(context); } void UserCloudPolicyManagerFactoryChromeOS::SetEmptyTestingFactory( diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h index c44a9fc..471bd61 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h @@ -21,20 +21,22 @@ namespace policy { class UserCloudPolicyManagerChromeOS; -// ProfileKeyedBaseFactory implementation for UserCloudPolicyManagerChromeOS -// instances that initialize per-profile cloud policy settings on ChromeOS. +// BrowserContextKeyedBaseFactory implementation +// for UserCloudPolicyManagerChromeOS instances that initialize per-profile +// cloud policy settings on ChromeOS. // // UserCloudPolicyManagerChromeOS is handled different than other -// ProfileKeyedServices because it is a dependency of PrefService. Therefore, -// lifetime of instances is managed by Profile, Profile startup code invokes -// CreateForProfile() explicitly, takes ownership, and the instance is only -// deleted after PrefService destruction. +// BrowserContextKeyedServices because it is a dependency of PrefService. +// Therefore, lifetime of instances is managed by Profile, Profile startup code +// invokes CreateForProfile() explicitly, takes ownership, and the instance +// is only deleted after PrefService destruction. // // TODO(mnissler): Remove the special lifetime management in favor of // PrefService directly depending on UserCloudPolicyManagerChromeOS once the -// former has been converted to a ProfileKeyedService. +// former has been converted to a BrowserContextKeyedService. // See also http://crbug.com/131843 and http://crbug.com/131844. -class UserCloudPolicyManagerFactoryChromeOS : public ProfileKeyedBaseFactory { +class UserCloudPolicyManagerFactoryChromeOS + : public BrowserContextKeyedBaseFactory { public: // Returns an instance of the UserCloudPolicyManagerFactoryChromeOS singleton. static UserCloudPolicyManagerFactoryChromeOS* GetInstance(); @@ -65,9 +67,11 @@ class UserCloudPolicyManagerFactoryChromeOS : public ProfileKeyedBaseFactory { Profile* profile, bool force_immediate_load); - // ProfileKeyedBaseFactory: - virtual void ProfileShutdown(content::BrowserContext* context) OVERRIDE; - virtual void ProfileDestroyed(content::BrowserContext* context) OVERRIDE; + // BrowserContextKeyedBaseFactory: + virtual void BrowserContextShutdown( + content::BrowserContext* context) OVERRIDE; + virtual void BrowserContextDestroyed( + content::BrowserContext* context) OVERRIDE; virtual void SetEmptyTestingFactory( content::BrowserContext* context) OVERRIDE; virtual void CreateServiceNow(content::BrowserContext* context) OVERRIDE; diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h index 70cc91e..952bd25 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h +++ b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h @@ -22,7 +22,7 @@ class UserCloudPolicyManagerChromeOS; // UserCloudPolicyManagerChromeOS, when it becomes available. This service // decouples the UserCloudPolicyManagerChromeOS from depending directly on the // TokenService, since it is initialized much earlier. -class UserCloudPolicyTokenForwarder : public ProfileKeyedService, +class UserCloudPolicyTokenForwarder : public BrowserContextKeyedService, public content::NotificationObserver { public: // The factory of this PKS depends on the factories of these two arguments, @@ -32,7 +32,7 @@ class UserCloudPolicyTokenForwarder : public ProfileKeyedService, TokenService* token_service); virtual ~UserCloudPolicyTokenForwarder(); - // ProfileKeyedService: + // BrowserContextKeyedService: virtual void Shutdown() OVERRIDE; // NotificationObserver: diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.cc b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.cc index 4869713..394c4a8 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.cc @@ -21,15 +21,16 @@ UserCloudPolicyTokenForwarderFactory* } UserCloudPolicyTokenForwarderFactory::UserCloudPolicyTokenForwarderFactory() - : ProfileKeyedServiceFactory("UserCloudPolicyTokenForwarder", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "UserCloudPolicyTokenForwarder", + BrowserContextDependencyManager::GetInstance()) { DependsOn(TokenServiceFactory::GetInstance()); DependsOn(UserCloudPolicyManagerFactoryChromeOS::GetInstance()); } UserCloudPolicyTokenForwarderFactory::~UserCloudPolicyTokenForwarderFactory() {} -ProfileKeyedService* +BrowserContextKeyedService* UserCloudPolicyTokenForwarderFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); @@ -51,7 +52,8 @@ ProfileKeyedService* return new UserCloudPolicyTokenForwarder(manager, token_service); } -bool UserCloudPolicyTokenForwarderFactory::ServiceIsCreatedWithProfile() const { +bool UserCloudPolicyTokenForwarderFactory:: +ServiceIsCreatedWithBrowserContext() const { // Create this object when the profile is created so it fetches the token // during startup. return true; diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.h b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.h index 8bdd62f..a904cbe80 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.h +++ b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.h @@ -19,7 +19,8 @@ class UserCloudPolicyTokenForwarder; // Creates instances of UserCloudPolicyTokenForwarder for Profiles that may need // to fetch the policy token. -class UserCloudPolicyTokenForwarderFactory : public ProfileKeyedServiceFactory { +class UserCloudPolicyTokenForwarderFactory + : public BrowserContextKeyedServiceFactory { public: // Returns an instance of the UserCloudPolicyTokenForwarderFactory singleton. static UserCloudPolicyTokenForwarderFactory* GetInstance(); @@ -30,10 +31,10 @@ class UserCloudPolicyTokenForwarderFactory : public ProfileKeyedServiceFactory { UserCloudPolicyTokenForwarderFactory(); virtual ~UserCloudPolicyTokenForwarderFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyTokenForwarderFactory); diff --git a/chrome/browser/content_settings/cookie_settings.cc b/chrome/browser/content_settings/cookie_settings.cc index e6eed22..2513a0c 100644 --- a/chrome/browser/content_settings/cookie_settings.cc +++ b/chrome/browser/content_settings/cookie_settings.cc @@ -50,7 +50,7 @@ scoped_refptr<CookieSettings> CookieSettings::Factory::GetForProfile( Profile* profile) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); return static_cast<CookieSettings*>( - GetInstance()->GetServiceForProfile(profile, true).get()); + GetInstance()->GetServiceForBrowserContext(profile, true).get()); } // static @@ -59,9 +59,9 @@ CookieSettings::Factory* CookieSettings::Factory::GetInstance() { } CookieSettings::Factory::Factory() - : RefcountedProfileKeyedServiceFactory( + : RefcountedBrowserContextKeyedServiceFactory( "CookieSettings", - ProfileDependencyManager::GetInstance()) { + BrowserContextDependencyManager::GetInstance()) { } CookieSettings::Factory::~Factory() {} @@ -79,7 +79,7 @@ content::BrowserContext* CookieSettings::Factory::GetBrowserContextToUse( return chrome::GetBrowserContextRedirectedInIncognito(context); } -scoped_refptr<RefcountedProfileKeyedService> +scoped_refptr<RefcountedBrowserContextKeyedService> CookieSettings::Factory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); diff --git a/chrome/browser/content_settings/cookie_settings.h b/chrome/browser/content_settings/cookie_settings.h index 9b85434..eec000b 100644 --- a/chrome/browser/content_settings/cookie_settings.h +++ b/chrome/browser/content_settings/cookie_settings.h @@ -26,7 +26,7 @@ class Profile; // A frontend to the cookie settings of |HostContentSettingsMap|. Handles // cookie-specific logic such as blocking third-party cookies. Written on the UI // thread and read on any thread. One instance per profile. -class CookieSettings : public RefcountedProfileKeyedService { +class CookieSettings : public RefcountedBrowserContextKeyedService { public: CookieSettings( HostContentSettingsMap* host_content_settings_map, @@ -101,7 +101,7 @@ class CookieSettings : public RefcountedProfileKeyedService { static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); - class Factory : public RefcountedProfileKeyedServiceFactory { + class Factory : public RefcountedBrowserContextKeyedServiceFactory { public: // Returns the |CookieSettings| associated with the |profile|. // @@ -116,12 +116,12 @@ class CookieSettings : public RefcountedProfileKeyedService { Factory(); virtual ~Factory(); - // |ProfileKeyedBaseFactory| methods: + // |BrowserContextKeyedBaseFactory| methods: virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual scoped_refptr<RefcountedProfileKeyedService> + virtual scoped_refptr<RefcountedBrowserContextKeyedService> BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; }; diff --git a/chrome/browser/custom_handlers/protocol_handler_registry.h b/chrome/browser/custom_handlers/protocol_handler_registry.h index 84b1ecf..79e44aa 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry.h +++ b/chrome/browser/custom_handlers/protocol_handler_registry.h @@ -33,7 +33,7 @@ class PrefRegistrySyncable; // instance of this class, which is initialized on browser start through // Profile::InitRegisteredProtocolHandlers(), and they should be the only // instances of this class. -class ProtocolHandlerRegistry : public ProfileKeyedService { +class ProtocolHandlerRegistry : public BrowserContextKeyedService { public: // Provides notification of when the OS level user agent settings diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc b/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc index 5e21cfc..be49e4e 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc +++ b/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc @@ -20,12 +20,13 @@ ProtocolHandlerRegistryFactory* ProtocolHandlerRegistryFactory::GetInstance() { ProtocolHandlerRegistry* ProtocolHandlerRegistryFactory::GetForProfile( Profile* profile) { return static_cast<ProtocolHandlerRegistry*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } ProtocolHandlerRegistryFactory::ProtocolHandlerRegistryFactory() - : ProfileKeyedServiceFactory("ProtocolHandlerRegistry", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ProtocolHandlerRegistry", + BrowserContextDependencyManager::GetInstance()) { } ProtocolHandlerRegistryFactory::~ProtocolHandlerRegistryFactory() { @@ -34,7 +35,8 @@ ProtocolHandlerRegistryFactory::~ProtocolHandlerRegistryFactory() { // Will be created when initializing profile_io_data, so we might // as well have the framework create this along with other // PKSs to preserve orderly civic conduct :) -bool ProtocolHandlerRegistryFactory::ServiceIsCreatedWithProfile() const { +bool +ProtocolHandlerRegistryFactory::ServiceIsCreatedWithBrowserContext() const { return true; } @@ -51,7 +53,8 @@ bool ProtocolHandlerRegistryFactory::ServiceIsNULLWhileTesting() const { return true; } -ProfileKeyedService* ProtocolHandlerRegistryFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +ProtocolHandlerRegistryFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { ProtocolHandlerRegistry* registry = new ProtocolHandlerRegistry( static_cast<Profile*>(profile), new ProtocolHandlerRegistry::Delegate()); diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_factory.h b/chrome/browser/custom_handlers/protocol_handler_registry_factory.h index 05cd6c9..14f97c6 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_factory.h +++ b/chrome/browser/custom_handlers/protocol_handler_registry_factory.h @@ -16,7 +16,8 @@ template <typename T> struct DefaultSingletonTraits; // Singleton that owns all ProtocolHandlerRegistrys and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated ProtocolHandlerRegistry. -class ProtocolHandlerRegistryFactory : public ProfileKeyedServiceFactory { +class ProtocolHandlerRegistryFactory + : public BrowserContextKeyedServiceFactory { public: // Returns the singleton instance of the ProtocolHandlerRegistryFactory. static ProtocolHandlerRegistryFactory* GetInstance(); @@ -26,8 +27,8 @@ class ProtocolHandlerRegistryFactory : public ProfileKeyedServiceFactory { static ProtocolHandlerRegistry* GetForProfile(Profile* profile); protected: - // ProfileKeyedServiceFactory implementation. - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + // BrowserContextKeyedServiceFactory implementation. + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; @@ -38,8 +39,8 @@ class ProtocolHandlerRegistryFactory : public ProfileKeyedServiceFactory { ProtocolHandlerRegistryFactory(); virtual ~ProtocolHandlerRegistryFactory(); - // ProfileKeyedServiceFactory implementation. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory implementation. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistryFactory); diff --git a/chrome/browser/download/download_service.h b/chrome/browser/download/download_service.h index e993f14..30e72e3 100644 --- a/chrome/browser/download/download_service.h +++ b/chrome/browser/download/download_service.h @@ -24,7 +24,7 @@ class DownloadManager; } // Owning class for ChromeDownloadManagerDelegate. -class DownloadService : public ProfileKeyedService { +class DownloadService : public BrowserContextKeyedService { public: explicit DownloadService(Profile* profile); virtual ~DownloadService(); diff --git a/chrome/browser/download/download_service_factory.cc b/chrome/browser/download/download_service_factory.cc index dc5ab53..28bab78 100644 --- a/chrome/browser/download/download_service_factory.cc +++ b/chrome/browser/download/download_service_factory.cc @@ -13,7 +13,7 @@ DownloadService* DownloadServiceFactory::GetForProfile( Profile* profile) { return static_cast<DownloadService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -22,15 +22,16 @@ DownloadServiceFactory* DownloadServiceFactory::GetInstance() { } DownloadServiceFactory::DownloadServiceFactory() - : ProfileKeyedServiceFactory("DownloadService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "DownloadService", + BrowserContextDependencyManager::GetInstance()) { DependsOn(HistoryServiceFactory::GetInstance()); } DownloadServiceFactory::~DownloadServiceFactory() { } -ProfileKeyedService* DownloadServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* DownloadServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { DownloadService* service = new DownloadService(static_cast<Profile*>(profile)); diff --git a/chrome/browser/download/download_service_factory.h b/chrome/browser/download/download_service_factory.h index fee17c0..f98803f 100644 --- a/chrome/browser/download/download_service_factory.h +++ b/chrome/browser/download/download_service_factory.h @@ -15,7 +15,7 @@ class Profile; // Singleton that owns all DownloadServices and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated DownloadService. -class DownloadServiceFactory : public ProfileKeyedServiceFactory { +class DownloadServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the DownloadService for |profile|, creating if not yet created. static DownloadService* GetForProfile(Profile* profile); @@ -23,8 +23,8 @@ class DownloadServiceFactory : public ProfileKeyedServiceFactory { static DownloadServiceFactory* GetInstance(); protected: - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/extensions/activity_log/activity_log.cc b/chrome/browser/extensions/activity_log/activity_log.cc index 994d3e2..b2980e6 100644 --- a/chrome/browser/extensions/activity_log/activity_log.cc +++ b/chrome/browser/extensions/activity_log/activity_log.cc @@ -129,7 +129,7 @@ ActivityLogFactory* ActivityLogFactory::GetInstance() { return Singleton<ActivityLogFactory>::get(); } -ProfileKeyedService* ActivityLogFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* ActivityLogFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new ActivityLog(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/activity_log/activity_log.h b/chrome/browser/extensions/activity_log/activity_log.h index b934d97..130f757 100644 --- a/chrome/browser/extensions/activity_log/activity_log.h +++ b/chrome/browser/extensions/activity_log/activity_log.h @@ -34,7 +34,7 @@ class Extension; // A utility for tracing interesting activity for each extension. // It writes to an ActivityDatabase on a separate thread to record the activity. -class ActivityLog : public ProfileKeyedService, +class ActivityLog : public BrowserContextKeyedService, public TabHelper::ScriptExecutionObserver { public: enum Activity { @@ -231,11 +231,11 @@ class ActivityLog : public ProfileKeyedService, // Each profile has different extensions, so we keep a different database for // each profile. -class ActivityLogFactory : public ProfileKeyedServiceFactory { +class ActivityLogFactory : public BrowserContextKeyedServiceFactory { public: static ActivityLog* GetForProfile(Profile* profile) { return static_cast<ActivityLog*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } static ActivityLogFactory* GetInstance(); @@ -243,11 +243,12 @@ class ActivityLogFactory : public ProfileKeyedServiceFactory { private: friend struct DefaultSingletonTraits<ActivityLogFactory>; ActivityLogFactory() - : ProfileKeyedServiceFactory("ActivityLog", - ProfileDependencyManager::GetInstance()) {} + : BrowserContextKeyedServiceFactory( + "ActivityLog", + BrowserContextDependencyManager::GetInstance()) {} virtual ~ActivityLogFactory() {} - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( diff --git a/chrome/browser/extensions/api/api_resource_manager.h b/chrome/browser/extensions/api/api_resource_manager.h index 14e3e01..bfa923a 100644 --- a/chrome/browser/extensions/api/api_resource_manager.h +++ b/chrome/browser/extensions/api/api_resource_manager.h @@ -24,7 +24,7 @@ namespace extensions { // An ApiResourceManager manages the lifetime of a set of resources that // ApiFunctions use. Examples are sockets or USB connections. template <class T> -class ApiResourceManager : public ProfileKeyedService, +class ApiResourceManager : public BrowserContextKeyedService, public base::NonThreadSafe, public content::NotificationObserver { public: diff --git a/chrome/browser/extensions/api/autotest_private/autotest_private_api.h b/chrome/browser/extensions/api/autotest_private/autotest_private_api.h index d55955c..bc0c0a2 100644 --- a/chrome/browser/extensions/api/autotest_private/autotest_private_api.h +++ b/chrome/browser/extensions/api/autotest_private/autotest_private_api.h @@ -55,7 +55,7 @@ class AutotestPrivateLoginStatusFunction: public SyncExtensionFunction { void SetAutotestPrivateTest(); // The profile-keyed service that manages the autotestPrivate extension API. -class AutotestPrivateAPI : public ProfileKeyedService { +class AutotestPrivateAPI : public BrowserContextKeyedService { public: AutotestPrivateAPI(); diff --git a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc index e2f1883..aef3874 100644 --- a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc +++ b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc @@ -15,7 +15,7 @@ namespace extensions { // static AutotestPrivateAPI* AutotestPrivateAPIFactory::GetForProfile(Profile* profile) { return static_cast<AutotestPrivateAPI*>(GetInstance()-> - GetServiceForProfile(profile, true)); + GetServiceForBrowserContext(profile, true)); } // static @@ -24,15 +24,16 @@ AutotestPrivateAPIFactory* AutotestPrivateAPIFactory::GetInstance() { } AutotestPrivateAPIFactory::AutotestPrivateAPIFactory() - : ProfileKeyedServiceFactory("AutotestPrivateAPI", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "AutotestPrivateAPI", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionSystemFactory::GetInstance()); } AutotestPrivateAPIFactory::~AutotestPrivateAPIFactory() { } -ProfileKeyedService* AutotestPrivateAPIFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* AutotestPrivateAPIFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new AutotestPrivateAPI(); } @@ -42,7 +43,7 @@ content::BrowserContext* AutotestPrivateAPIFactory::GetBrowserContextToUse( return chrome::GetBrowserContextRedirectedInIncognito(context); } -bool AutotestPrivateAPIFactory::ServiceIsCreatedWithProfile() const { +bool AutotestPrivateAPIFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h index 9c3cf28..a960504 100644 --- a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h +++ b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h @@ -13,7 +13,7 @@ class Profile; namespace extensions { class AutotestPrivateAPI; -class AutotestPrivateAPIFactory : public ProfileKeyedServiceFactory { +class AutotestPrivateAPIFactory : public BrowserContextKeyedServiceFactory { public: static AutotestPrivateAPI* GetForProfile(Profile* profile); @@ -25,12 +25,12 @@ class AutotestPrivateAPIFactory : public ProfileKeyedServiceFactory { AutotestPrivateAPIFactory(); virtual ~AutotestPrivateAPIFactory(); - // ProfileKeyedBaseFactory implementation. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedBaseFactory implementation. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h index d80a39f..f97cf95 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h @@ -30,7 +30,7 @@ namespace extensions { class ExtensionBluetoothEventRouter; // The profile-keyed service that manages the bluetooth extension API. -class BluetoothAPI : public ProfileKeyedService, +class BluetoothAPI : public BrowserContextKeyedService, public EventRouter::Observer { public: // Convenience method to get the BluetoothAPI for a profile. @@ -41,7 +41,7 @@ class BluetoothAPI : public ProfileKeyedService, ExtensionBluetoothEventRouter* bluetooth_event_router(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // EventRouter::Observer implementation. diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc index 00f0cf6..71a3a4b 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc @@ -15,7 +15,7 @@ namespace extensions { // static BluetoothAPI* BluetoothAPIFactory::GetForProfile(Profile* profile) { return static_cast<BluetoothAPI*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -24,15 +24,16 @@ BluetoothAPIFactory* BluetoothAPIFactory::GetInstance() { } BluetoothAPIFactory::BluetoothAPIFactory() - : ProfileKeyedServiceFactory("BluetoothAPI", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "BluetoothAPI", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionSystemFactory::GetInstance()); } BluetoothAPIFactory::~BluetoothAPIFactory() { } -ProfileKeyedService* BluetoothAPIFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* BluetoothAPIFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new BluetoothAPI(static_cast<Profile*>(profile)); } @@ -42,7 +43,7 @@ content::BrowserContext* BluetoothAPIFactory::GetBrowserContextToUse( return chrome::GetBrowserContextRedirectedInIncognito(context); } -bool BluetoothAPIFactory::ServiceIsCreatedWithProfile() const { +bool BluetoothAPIFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h index 6181224..cd5662c 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h @@ -14,7 +14,7 @@ namespace extensions { class BluetoothAPI; -class BluetoothAPIFactory : public ProfileKeyedServiceFactory { +class BluetoothAPIFactory : public BrowserContextKeyedServiceFactory { public: static BluetoothAPI* GetForProfile(Profile* profile); @@ -26,12 +26,12 @@ class BluetoothAPIFactory : public ProfileKeyedServiceFactory { BluetoothAPIFactory(); virtual ~BluetoothAPIFactory(); - // ProfileKeyedServiceFactory implementation. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory implementation. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc index 8c2599d..b5a3446 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc @@ -70,7 +70,7 @@ class FakeExtensionSystem : public extensions::TestExtensionSystem { DISALLOW_COPY_AND_ASSIGN(FakeExtensionSystem); }; -ProfileKeyedService* BuildFakeExtensionSystem( +BrowserContextKeyedService* BuildFakeExtensionSystem( content::BrowserContext* profile) { return new FakeExtensionSystem(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.h b/chrome/browser/extensions/api/bookmarks/bookmarks_api.h index b8bb199..638828a 100644 --- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.h +++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.h @@ -75,7 +75,7 @@ class BookmarksAPI : public ProfileKeyedAPI, explicit BookmarksAPI(Profile* profile); virtual ~BookmarksAPI(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // ProfileKeyedAPI implementation. diff --git a/chrome/browser/extensions/api/cookies/cookies_api.h b/chrome/browser/extensions/api/cookies/cookies_api.h index 4fd944c..ef6ae38 100644 --- a/chrome/browser/extensions/api/cookies/cookies_api.h +++ b/chrome/browser/extensions/api/cookies/cookies_api.h @@ -199,7 +199,7 @@ class CookiesAPI : public ProfileKeyedAPI, explicit CookiesAPI(Profile* profile); virtual ~CookiesAPI(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // ProfileKeyedAPI implementation. diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.h b/chrome/browser/extensions/api/developer_private/developer_private_api.h index dd1687a..2f2d41a 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.h +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.h @@ -55,7 +55,7 @@ typedef std::vector<linked_ptr<developer::ItemInspectView> > namespace extensions { // The profile-keyed service that manages the DeveloperPrivate API. -class DeveloperPrivateAPI : public ProfileKeyedService, +class DeveloperPrivateAPI : public BrowserContextKeyedService, public content::NotificationObserver { public: // Convenience method to get the DeveloperPrivateAPI for a profile. @@ -70,7 +70,7 @@ class DeveloperPrivateAPI : public ProfileKeyedService, return last_unpacked_directory_; } - // ProfileKeyedService implementation + // BrowserContextKeyedService implementation virtual void Shutdown() OVERRIDE; // content::NotificationObserver implementation. diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc index fd12543..f365430 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc @@ -16,7 +16,7 @@ namespace extensions { DeveloperPrivateAPI* DeveloperPrivateAPIFactory::GetForProfile( Profile* profile) { return static_cast<DeveloperPrivateAPI*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -25,15 +25,16 @@ DeveloperPrivateAPIFactory* DeveloperPrivateAPIFactory::GetInstance() { } DeveloperPrivateAPIFactory::DeveloperPrivateAPIFactory() - : ProfileKeyedServiceFactory("DeveloperPrivateAPI", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "DeveloperPrivateAPI", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionSystemFactory::GetInstance()); } DeveloperPrivateAPIFactory::~DeveloperPrivateAPIFactory() { } -ProfileKeyedService* DeveloperPrivateAPIFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* DeveloperPrivateAPIFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new DeveloperPrivateAPI(static_cast<Profile*>(profile)); } @@ -43,7 +44,7 @@ content::BrowserContext* DeveloperPrivateAPIFactory::GetBrowserContextToUse( return chrome::GetBrowserContextRedirectedInIncognito(context); } -bool DeveloperPrivateAPIFactory::ServiceIsCreatedWithProfile() const { +bool DeveloperPrivateAPIFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h index dfe4044..9d7d157 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h +++ b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h @@ -16,7 +16,7 @@ class DeveloperPrivateAPI; // This is a singleton class which holds profileKeyed references to // DeveloperPrivateAPI class. -class DeveloperPrivateAPIFactory : public ProfileKeyedServiceFactory { +class DeveloperPrivateAPIFactory : public BrowserContextKeyedServiceFactory { public: static DeveloperPrivateAPI* GetForProfile(Profile* profile); @@ -28,12 +28,12 @@ class DeveloperPrivateAPIFactory : public ProfileKeyedServiceFactory { DeveloperPrivateAPIFactory(); virtual ~DeveloperPrivateAPIFactory(); - // ProfileKeyedServiceFactory implementation. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory implementation. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/extensions/api/dial/dial_api.cc b/chrome/browser/extensions/api/dial/dial_api.cc index 8ec81c3..5bb271c 100644 --- a/chrome/browser/extensions/api/dial/dial_api.cc +++ b/chrome/browser/extensions/api/dial/dial_api.cc @@ -35,7 +35,7 @@ const size_t kDialMaxDevices = 256; namespace extensions { DialAPI::DialAPI(Profile* profile) - : RefcountedProfileKeyedService(content::BrowserThread::IO), + : RefcountedBrowserContextKeyedService(content::BrowserThread::IO), profile_(profile) { ExtensionSystem::Get(profile)->event_router()->RegisterObserver( this, extensions::event_names::kOnDialDeviceList); diff --git a/chrome/browser/extensions/api/dial/dial_api.h b/chrome/browser/extensions/api/dial/dial_api.h index 8a36044..74e284e 100644 --- a/chrome/browser/extensions/api/dial/dial_api.h +++ b/chrome/browser/extensions/api/dial/dial_api.h @@ -17,11 +17,11 @@ namespace extensions { class DialRegistry; -// Dial API which is a ref-counted ProfileKeyedService that manages the DIAL -// registry. It takes care of creating the registry on the IO thread and -// is an observer of the registry. It makes sure devices events are sent out +// Dial API which is a ref-counted BrowserContextKeyedService that manages +// the DIAL registry. It takes care of creating the registry on the IO thread +// and is an observer of the registry. It makes sure devices events are sent out // to extension listeners on the right thread. -class DialAPI : public RefcountedProfileKeyedService, +class DialAPI : public RefcountedBrowserContextKeyedService, public EventRouter::Observer, public DialRegistry::Observer { public: @@ -39,7 +39,7 @@ class DialAPI : public RefcountedProfileKeyedService, private: virtual ~DialAPI(); - // RefcountedProfileKeyedService: + // RefcountedBrowserContextKeyedService: virtual void ShutdownOnUIThread() OVERRIDE; // EventRouter::Observer: diff --git a/chrome/browser/extensions/api/dial/dial_api_factory.cc b/chrome/browser/extensions/api/dial/dial_api_factory.cc index 33dc740..8b11002 100644 --- a/chrome/browser/extensions/api/dial/dial_api_factory.cc +++ b/chrome/browser/extensions/api/dial/dial_api_factory.cc @@ -13,7 +13,7 @@ namespace extensions { // static scoped_refptr<DialAPI> DialAPIFactory::GetForProfile(Profile* profile) { return static_cast<DialAPI*>( - GetInstance()->GetServiceForProfile(profile, true).get()); + GetInstance()->GetServiceForBrowserContext(profile, true).get()); } // static @@ -21,21 +21,21 @@ DialAPIFactory* DialAPIFactory::GetInstance() { return Singleton<DialAPIFactory>::get(); } -DialAPIFactory::DialAPIFactory() : RefcountedProfileKeyedServiceFactory( - "DialAPI", ProfileDependencyManager::GetInstance()) { +DialAPIFactory::DialAPIFactory() : RefcountedBrowserContextKeyedServiceFactory( + "DialAPI", BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionSystemFactory::GetInstance()); } DialAPIFactory::~DialAPIFactory() { } -scoped_refptr<RefcountedProfileKeyedService> +scoped_refptr<RefcountedBrowserContextKeyedService> DialAPIFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return scoped_refptr<DialAPI>(new DialAPI(static_cast<Profile*>(profile))); } -bool DialAPIFactory::ServiceIsCreatedWithProfile() const { +bool DialAPIFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/extensions/api/dial/dial_api_factory.h b/chrome/browser/extensions/api/dial/dial_api_factory.h index ecce597..39a25cd 100644 --- a/chrome/browser/extensions/api/dial/dial_api_factory.h +++ b/chrome/browser/extensions/api/dial/dial_api_factory.h @@ -8,11 +8,13 @@ #include "base/memory/singleton.h" #include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h" +class Profile; + namespace extensions { class DialAPI; -class DialAPIFactory : public RefcountedProfileKeyedServiceFactory { +class DialAPIFactory : public RefcountedBrowserContextKeyedServiceFactory { public: static scoped_refptr<DialAPI> GetForProfile(Profile* profile); @@ -24,10 +26,10 @@ class DialAPIFactory : public RefcountedProfileKeyedServiceFactory { DialAPIFactory(); virtual ~DialAPIFactory(); - // ProfileKeyedServiceFactory: - virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - content::BrowserContext* profile) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + // BrowserContextKeyedServiceFactory: + virtual scoped_refptr<RefcountedBrowserContextKeyedService> + BuildServiceInstanceFor(content::BrowserContext* profile) const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(DialAPIFactory); diff --git a/chrome/browser/extensions/api/discovery/suggested_links_registry.h b/chrome/browser/extensions/api/discovery/suggested_links_registry.h index 89b119d..a0ebb17 100644 --- a/chrome/browser/extensions/api/discovery/suggested_links_registry.h +++ b/chrome/browser/extensions/api/discovery/suggested_links_registry.h @@ -15,7 +15,7 @@ namespace extensions { // This class keeps track of links suggested by an extension using the discovery // API. -class SuggestedLinksRegistry : public ProfileKeyedService { +class SuggestedLinksRegistry : public BrowserContextKeyedService { public: // A list of ExtensionSuggestedLink's. typedef std::vector<linked_ptr<extensions::SuggestedLink> > SuggestedLinkList; diff --git a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc index 33ae3da..f392999 100644 --- a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc +++ b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc @@ -16,7 +16,7 @@ namespace extensions { SuggestedLinksRegistry* SuggestedLinksRegistryFactory::GetForProfile( Profile* profile) { return static_cast<SuggestedLinksRegistry*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -24,20 +24,22 @@ SuggestedLinksRegistryFactory* SuggestedLinksRegistryFactory::GetInstance() { return Singleton<SuggestedLinksRegistryFactory>::get(); } -bool SuggestedLinksRegistryFactory::ServiceIsCreatedWithProfile() const { +bool SuggestedLinksRegistryFactory::ServiceIsCreatedWithBrowserContext() const { return true; } SuggestedLinksRegistryFactory::SuggestedLinksRegistryFactory() - : ProfileKeyedServiceFactory("SuggestedLinksRegistry", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "SuggestedLinksRegistry", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionSystemFactory::GetInstance()); } SuggestedLinksRegistryFactory::~SuggestedLinksRegistryFactory() { } -ProfileKeyedService* SuggestedLinksRegistryFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +SuggestedLinksRegistryFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new SuggestedLinksRegistry(); } diff --git a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h index 3ec5413..1637b60 100644 --- a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h +++ b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h @@ -15,14 +15,14 @@ namespace extensions { class SuggestedLinksRegistry; // Singleton that associate SuggestedLinksRegistry objects with Profiles. -class SuggestedLinksRegistryFactory : public ProfileKeyedServiceFactory { +class SuggestedLinksRegistryFactory : public BrowserContextKeyedServiceFactory { public: static SuggestedLinksRegistry* GetForProfile(Profile* profile); static SuggestedLinksRegistryFactory* GetInstance(); - // Overridden from ProfileKeyedBaseFactory: - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + // Overridden from BrowserContextKeyedBaseFactory: + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; private: friend struct DefaultSingletonTraits<SuggestedLinksRegistryFactory>; @@ -30,8 +30,8 @@ class SuggestedLinksRegistryFactory : public ProfileKeyedServiceFactory { SuggestedLinksRegistryFactory(); virtual ~SuggestedLinksRegistryFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/extensions/api/history/history_api.h b/chrome/browser/extensions/api/history/history_api.h index a93654d..3d2dd04 100644 --- a/chrome/browser/extensions/api/history/history_api.h +++ b/chrome/browser/extensions/api/history/history_api.h @@ -60,7 +60,7 @@ class HistoryAPI : public ProfileKeyedAPI, explicit HistoryAPI(Profile* profile); virtual ~HistoryAPI(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // ProfileKeyedAPI implementation. diff --git a/chrome/browser/extensions/api/identity/experimental_identity_apitest.cc b/chrome/browser/extensions/api/identity/experimental_identity_apitest.cc index 33b60c4..eb9553a 100644 --- a/chrome/browser/extensions/api/identity/experimental_identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/experimental_identity_apitest.cc @@ -177,7 +177,7 @@ class TestOAuth2MintTokenFlow : public OAuth2MintTokenFlow { OAuth2MintTokenFlow::Delegate* delegate_; }; -ProfileKeyedService* IdentityAPITestFactory(Profile* profile) { +BrowserContextKeyedService* IdentityAPITestFactory(Profile* profile) { return new IdentityAPI(profile); } diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc index 3dc060c..b18c138 100644 --- a/chrome/browser/extensions/api/identity/identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/identity_apitest.cc @@ -184,7 +184,8 @@ class TestOAuth2MintTokenFlow : public OAuth2MintTokenFlow { OAuth2MintTokenFlow::Delegate* delegate_; }; -ProfileKeyedService* IdentityAPITestFactory(content::BrowserContext* profile) { +BrowserContextKeyedService* IdentityAPITestFactory( + content::BrowserContext* profile) { return new IdentityAPI(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/api/idle/idle_api_unittest.cc b/chrome/browser/extensions/api/idle/idle_api_unittest.cc index 22f0fb1..e55ef07 100644 --- a/chrome/browser/extensions/api/idle/idle_api_unittest.cc +++ b/chrome/browser/extensions/api/idle/idle_api_unittest.cc @@ -118,7 +118,8 @@ ScopedListen::~ScopedListen() { idle_manager_->OnListenerRemoved(details); } -ProfileKeyedService* IdleManagerTestFactory(content::BrowserContext* profile) { +BrowserContextKeyedService* IdleManagerTestFactory( + content::BrowserContext* profile) { return new IdleManager(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/api/idle/idle_manager.h b/chrome/browser/extensions/api/idle/idle_manager.h index dbfcee4..96d8723 100644 --- a/chrome/browser/extensions/api/idle/idle_manager.h +++ b/chrome/browser/extensions/api/idle/idle_manager.h @@ -39,7 +39,7 @@ struct IdleMonitor { class IdleManager : public content::NotificationObserver, public EventRouter::Observer, - public ProfileKeyedService { + public BrowserContextKeyedService { public: class IdleTimeProvider { public: @@ -72,7 +72,7 @@ class IdleManager : public content::NotificationObserver, void Init(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // content::NotificationDelegate implementation. diff --git a/chrome/browser/extensions/api/idle/idle_manager_factory.cc b/chrome/browser/extensions/api/idle/idle_manager_factory.cc index 96e2c35..1bd7c51 100644 --- a/chrome/browser/extensions/api/idle/idle_manager_factory.cc +++ b/chrome/browser/extensions/api/idle/idle_manager_factory.cc @@ -16,7 +16,7 @@ namespace extensions { IdleManager* IdleManagerFactory::GetForProfile( Profile* profile) { return static_cast<IdleManager*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -25,15 +25,16 @@ IdleManagerFactory* IdleManagerFactory::GetInstance() { } IdleManagerFactory::IdleManagerFactory() - : ProfileKeyedServiceFactory("IdleManager", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "IdleManager", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionSystemFactory::GetInstance()); } IdleManagerFactory::~IdleManagerFactory() { } -ProfileKeyedService* IdleManagerFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* IdleManagerFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { IdleManager* idle_manager = new IdleManager(static_cast<Profile*>(profile)); idle_manager->Init(); @@ -45,7 +46,7 @@ content::BrowserContext* IdleManagerFactory::GetBrowserContextToUse( return chrome::GetBrowserContextRedirectedInIncognito(context); } -bool IdleManagerFactory::ServiceIsCreatedWithProfile() const { +bool IdleManagerFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/extensions/api/idle/idle_manager_factory.h b/chrome/browser/extensions/api/idle/idle_manager_factory.h index c9946be..2ff9605 100644 --- a/chrome/browser/extensions/api/idle/idle_manager_factory.h +++ b/chrome/browser/extensions/api/idle/idle_manager_factory.h @@ -13,7 +13,7 @@ class Profile; namespace extensions { class IdleManager; -class IdleManagerFactory : public ProfileKeyedServiceFactory { +class IdleManagerFactory : public BrowserContextKeyedServiceFactory { public: static IdleManager* GetForProfile(Profile* profile); @@ -25,12 +25,12 @@ class IdleManagerFactory : public ProfileKeyedServiceFactory { IdleManagerFactory(); virtual ~IdleManagerFactory(); - // ProfileKeyedBaseFactory implementation. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedBaseFactory implementation. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/extensions/api/managed_mode_private/managed_mode_private_api.h b/chrome/browser/extensions/api/managed_mode_private/managed_mode_private_api.h index 7b4cfae..2344dc9 100644 --- a/chrome/browser/extensions/api/managed_mode_private/managed_mode_private_api.h +++ b/chrome/browser/extensions/api/managed_mode_private/managed_mode_private_api.h @@ -90,7 +90,7 @@ class ManagedModeAPI : public ProfileKeyedAPI, explicit ManagedModeAPI(Profile* profile); virtual ~ManagedModeAPI(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // ProfileKeyedAPIFactory implementation. diff --git a/chrome/browser/extensions/api/management/management_api.h b/chrome/browser/extensions/api/management/management_api.h index 815ff6a..f9566ea 100644 --- a/chrome/browser/extensions/api/management/management_api.h +++ b/chrome/browser/extensions/api/management/management_api.h @@ -196,7 +196,7 @@ class ManagementAPI : public ProfileKeyedAPI, explicit ManagementAPI(Profile* profile); virtual ~ManagementAPI(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // ProfileKeyedAPI implementation. diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h index af0e1ea..5bd4ed8 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h @@ -31,7 +31,7 @@ class MediaGalleriesPrivateAPI : public ProfileKeyedAPI, explicit MediaGalleriesPrivateAPI(Profile* profile); virtual ~MediaGalleriesPrivateAPI(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // ProfileKeyedAPI implementation. diff --git a/chrome/browser/extensions/api/preference/preference_api.h b/chrome/browser/extensions/api/preference/preference_api.h index c2a85de..0a3c7c1 100644 --- a/chrome/browser/extensions/api/preference/preference_api.h +++ b/chrome/browser/extensions/api/preference/preference_api.h @@ -45,7 +45,7 @@ class PreferenceAPI : public ProfileKeyedAPI, explicit PreferenceAPI(Profile* profile); virtual ~PreferenceAPI(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // ProfileKeyedAPI implementation. diff --git a/chrome/browser/extensions/api/processes/processes_api.h b/chrome/browser/extensions/api/processes/processes_api.h index 224b9cc..312dd96 100644 --- a/chrome/browser/extensions/api/processes/processes_api.h +++ b/chrome/browser/extensions/api/processes/processes_api.h @@ -98,7 +98,7 @@ class ProcessesAPI : public ProfileKeyedAPI, explicit ProcessesAPI(Profile* profile); virtual ~ProcessesAPI(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // ProfileKeyedAPI implementation. diff --git a/chrome/browser/extensions/api/profile_keyed_api_factory.h b/chrome/browser/extensions/api/profile_keyed_api_factory.h index d6267de2..384eb3ed 100644 --- a/chrome/browser/extensions/api/profile_keyed_api_factory.h +++ b/chrome/browser/extensions/api/profile_keyed_api_factory.h @@ -19,12 +19,12 @@ class ProfileKeyedAPIFactory; // Instantiations of ProfileKeyedAPIFactory should use this base class // and also define a static const char* service_name() function (used in the -// ProfileKeyedBaseFactory constructor). These fields should be accessible -// to the ProfileKeyedAPIFactory for the service. -class ProfileKeyedAPI : public ProfileKeyedService { +// BrowserContextKeyedBaseFactory constructor). These fields should +// be accessible to the ProfileKeyedAPIFactory for the service. +class ProfileKeyedAPI : public BrowserContextKeyedService { protected: // Defaults for flags that control ProfileKeyedAPIFactory behavior. - // See ProfileKeyedBaseFactory for usage. + // See BrowserContextKeyedBaseFactory for usage. static const bool kServiceRedirectedInIncognito = false; static const bool kServiceIsNULLWhileTesting = false; static const bool kServiceHasOwnInstanceInIncognito = false; @@ -52,15 +52,16 @@ class ProfileKeyedAPI : public ProfileKeyedService { // } }; -// A template for factories for ProfileKeyedServices that manage extension APIs. -// T is a ProfileKeyedService that uses this factory template instead of -// its own separate factory definition to manage its per-profile instances. +// A template for factories for BrowserContextKeyedServices that manage +// extension APIs. T is a BrowserContextKeyedService that uses this factory +// template instead of its own separate factory definition to manage its +// per-profile instances. template <typename T> -class ProfileKeyedAPIFactory : public ProfileKeyedServiceFactory { +class ProfileKeyedAPIFactory : public BrowserContextKeyedServiceFactory { public: static T* GetForProfile(Profile* profile) { return static_cast<T*>( - T::GetFactoryInstance()->GetServiceForProfile(profile, true)); + T::GetFactoryInstance()->GetServiceForBrowserContext(profile, true)); } // Declare dependencies on other factories. @@ -78,8 +79,9 @@ class ProfileKeyedAPIFactory : public ProfileKeyedServiceFactory { } ProfileKeyedAPIFactory() - : ProfileKeyedServiceFactory(T::service_name(), - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + T::service_name(), + BrowserContextDependencyManager::GetInstance()) { DeclareFactoryDependencies(); } @@ -87,13 +89,13 @@ class ProfileKeyedAPIFactory : public ProfileKeyedServiceFactory { } private: - // ProfileKeyedServiceFactory implementation. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory implementation. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE { return new T(static_cast<Profile*>(profile)); } - // ProfileKeyedBaseFactory implementation. + // BrowserContextKeyedBaseFactory implementation. // These can be effectively overridden with template specializations. virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE { @@ -103,10 +105,10 @@ class ProfileKeyedAPIFactory : public ProfileKeyedServiceFactory { if (T::kServiceHasOwnInstanceInIncognito) return chrome::GetBrowserContextOwnInstanceInIncognito(context); - return ProfileKeyedServiceFactory::GetBrowserContextToUse(context); + return BrowserContextKeyedServiceFactory::GetBrowserContextToUse(context); } - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE { + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE { return true; } diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h index 3c9c803..76c0005 100644 --- a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h +++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h @@ -106,7 +106,7 @@ class PushMessagingAPI : public ProfileKeyedAPI, // Convenience method to get the PushMessagingAPI for a profile. static PushMessagingAPI* Get(Profile* profile); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // ProfileKeyedAPI implementation. diff --git a/chrome/browser/extensions/api/storage/settings_test_util.cc b/chrome/browser/extensions/api/storage/settings_test_util.cc index d3c4b7d..f6e714a 100644 --- a/chrome/browser/extensions/api/storage/settings_test_util.cc +++ b/chrome/browser/extensions/api/storage/settings_test_util.cc @@ -124,7 +124,7 @@ ExtensionService* MockExtensionSystem::extension_service() { return static_cast<ExtensionService*>(as_interface); } -ProfileKeyedService* BuildMockExtensionSystem( +BrowserContextKeyedService* BuildMockExtensionSystem( content::BrowserContext* profile) { return new MockExtensionSystem(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h index aeb09d1..25aadf8 100644 --- a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h +++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h @@ -23,7 +23,7 @@ namespace extensions { // Observes changes in SyncFileSystem and relays events to JS Extension API. class ExtensionSyncEventObserver : public sync_file_system::SyncEventObserver, - public ProfileKeyedService { + public BrowserContextKeyedService { public: explicit ExtensionSyncEventObserver(Profile* profile); virtual ~ExtensionSyncEventObserver(); @@ -32,7 +32,7 @@ class ExtensionSyncEventObserver sync_file_system::SyncFileSystemService* sync_service, const std::string& service_name); - // ProfileKeyedService override. + // BrowserContextKeyedService override. virtual void Shutdown() OVERRIDE; // sync_file_system::SyncEventObserver interface implementation. diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc index 9b9030e..08219fb 100644 --- a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc +++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc @@ -16,7 +16,7 @@ namespace extensions { ExtensionSyncEventObserver* ExtensionSyncEventObserverFactory::GetForProfile(Profile* profile) { return static_cast<ExtensionSyncEventObserver*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -26,15 +26,17 @@ ExtensionSyncEventObserverFactory::GetInstance() { } ExtensionSyncEventObserverFactory::ExtensionSyncEventObserverFactory() - : ProfileKeyedServiceFactory("ExtensionSyncEventObserver", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ExtensionSyncEventObserver", + BrowserContextDependencyManager::GetInstance()) { DependsOn(sync_file_system::SyncFileSystemServiceFactory::GetInstance()); DependsOn(ExtensionSystemFactory::GetInstance()); } ExtensionSyncEventObserverFactory::~ExtensionSyncEventObserverFactory() {} -ProfileKeyedService* ExtensionSyncEventObserverFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +ExtensionSyncEventObserverFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new ExtensionSyncEventObserver(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h index eb9a407..65c14fc 100644 --- a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h +++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h @@ -14,7 +14,8 @@ namespace extensions { class ExtensionSyncEventObserver; -class ExtensionSyncEventObserverFactory : public ProfileKeyedServiceFactory { +class ExtensionSyncEventObserverFactory + : public BrowserContextKeyedServiceFactory { public: static ExtensionSyncEventObserver* GetForProfile(Profile* profile); @@ -26,8 +27,8 @@ class ExtensionSyncEventObserverFactory : public ProfileKeyedServiceFactory { ExtensionSyncEventObserverFactory(); virtual ~ExtensionSyncEventObserverFactory(); - // ProfileKeyedServiceFactory implementation. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory implementation. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h index 47da265..a2e403f 100644 --- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h +++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h @@ -30,12 +30,12 @@ class ExtensionIndicatorIcon; // that are currently visible in the UI. Use SystemIndicatorManagerFactory to // create a SystemIndicatorManager object. class SystemIndicatorManager : public content::NotificationObserver, - public ProfileKeyedService { + public BrowserContextKeyedService { public: SystemIndicatorManager(Profile* profile, StatusTray* status_tray); virtual ~SystemIndicatorManager(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // content::NotificationDelegate implementation. diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc index cf3fcc5..76e74ef 100644 --- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc +++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc @@ -16,7 +16,7 @@ namespace extensions { SystemIndicatorManager* SystemIndicatorManagerFactory::GetForProfile( Profile* profile) { return static_cast<SystemIndicatorManager*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -25,14 +25,16 @@ SystemIndicatorManagerFactory* SystemIndicatorManagerFactory::GetInstance() { } SystemIndicatorManagerFactory::SystemIndicatorManagerFactory() - : ProfileKeyedServiceFactory("SystemIndicatorManager", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "SystemIndicatorManager", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionSystemFactory::GetInstance()); } SystemIndicatorManagerFactory::~SystemIndicatorManagerFactory() {} -ProfileKeyedService* SystemIndicatorManagerFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +SystemIndicatorManagerFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { StatusTray* status_tray = g_browser_process->status_tray(); diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h index 01e417d..ad6f3d9 100644 --- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h +++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h @@ -13,8 +13,8 @@ class Profile; namespace extensions { class SystemIndicatorManager; -// ProfileKeyedServiceFactory for each SystemIndicatorManager. -class SystemIndicatorManagerFactory : public ProfileKeyedServiceFactory { +// BrowserContextKeyedServiceFactory for each SystemIndicatorManager. +class SystemIndicatorManagerFactory : public BrowserContextKeyedServiceFactory { public: static SystemIndicatorManager* GetForProfile(Profile* profile); @@ -26,8 +26,8 @@ class SystemIndicatorManagerFactory : public ProfileKeyedServiceFactory { SystemIndicatorManagerFactory(); virtual ~SystemIndicatorManagerFactory(); - // ProfileKeyedBaseFactory implementation. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedBaseFactory implementation. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/extensions/api/system_info/system_info_api.h b/chrome/browser/extensions/api/system_info/system_info_api.h index eb96a4a..3fbb7fa 100644 --- a/chrome/browser/extensions/api/system_info/system_info_api.h +++ b/chrome/browser/extensions/api/system_info/system_info_api.h @@ -21,7 +21,7 @@ class SystemInfoAPI : public ProfileKeyedAPI, explicit SystemInfoAPI(Profile* profile); virtual ~SystemInfoAPI(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // EventRouter::Observer implementation. diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h index e245aa1..6472f1a 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h @@ -24,7 +24,7 @@ class FullscreenObserver; namespace tab_capture = extensions::api::tab_capture; -class TabCaptureRegistry : public ProfileKeyedService, +class TabCaptureRegistry : public BrowserContextKeyedService, public content::NotificationObserver, public MediaCaptureDevicesDispatcher::Observer { public: diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc index 6e46fee..e48fcf9 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc @@ -16,7 +16,7 @@ namespace extensions { // static TabCaptureRegistry* TabCaptureRegistryFactory::GetForProfile(Profile* profile) { return static_cast<TabCaptureRegistry*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -24,20 +24,21 @@ TabCaptureRegistryFactory* TabCaptureRegistryFactory::GetInstance() { return Singleton<TabCaptureRegistryFactory>::get(); } -bool TabCaptureRegistryFactory::ServiceIsCreatedWithProfile() const { +bool TabCaptureRegistryFactory::ServiceIsCreatedWithBrowserContext() const { return false; } TabCaptureRegistryFactory::TabCaptureRegistryFactory() - : ProfileKeyedServiceFactory("TabCaptureRegistry", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "TabCaptureRegistry", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionSystemFactory::GetInstance()); } TabCaptureRegistryFactory::~TabCaptureRegistryFactory() { } -ProfileKeyedService* TabCaptureRegistryFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* TabCaptureRegistryFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new TabCaptureRegistry(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h index 8411720..afd75d5 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h @@ -14,14 +14,14 @@ namespace extensions { class TabCaptureRegistry; -class TabCaptureRegistryFactory : public ProfileKeyedServiceFactory { +class TabCaptureRegistryFactory : public BrowserContextKeyedServiceFactory { public: static TabCaptureRegistry* GetForProfile(Profile* profile); static TabCaptureRegistryFactory* GetInstance(); - // ProfileKeyedBaseFactory: - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + // BrowserContextKeyedBaseFactory: + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; private: friend struct DefaultSingletonTraits<TabCaptureRegistryFactory>; @@ -29,8 +29,8 @@ class TabCaptureRegistryFactory : public ProfileKeyedServiceFactory { TabCaptureRegistryFactory(); virtual ~TabCaptureRegistryFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/extensions/api/tabs/tabs_windows_api.h b/chrome/browser/extensions/api/tabs/tabs_windows_api.h index d4372ef..ba79469 100644 --- a/chrome/browser/extensions/api/tabs/tabs_windows_api.h +++ b/chrome/browser/extensions/api/tabs/tabs_windows_api.h @@ -24,7 +24,7 @@ class TabsWindowsAPI : public ProfileKeyedAPI, WindowsEventRouter* windows_event_router(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // ProfileKeyedAPI implementation. diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.h b/chrome/browser/extensions/api/web_navigation/web_navigation_api.h index 8277a02..bae2e27 100644 --- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.h +++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.h @@ -224,7 +224,7 @@ class WebNavigationAPI : public ProfileKeyedAPI, explicit WebNavigationAPI(Profile* profile); virtual ~WebNavigationAPI(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // ProfileKeyedAPI implementation. diff --git a/chrome/browser/extensions/extension_action_manager.cc b/chrome/browser/extensions/extension_action_manager.cc index 21e0db7..4c32560 100644 --- a/chrome/browser/extensions/extension_action_manager.cc +++ b/chrome/browser/extensions/extension_action_manager.cc @@ -25,13 +25,13 @@ namespace extensions { namespace { -// ProfileKeyedServiceFactory for ExtensionActionManager. -class ExtensionActionManagerFactory : public ProfileKeyedServiceFactory { +// BrowserContextKeyedServiceFactory for ExtensionActionManager. +class ExtensionActionManagerFactory : public BrowserContextKeyedServiceFactory { public: - // ProfileKeyedServiceFactory implementation: + // BrowserContextKeyedServiceFactory implementation: static ExtensionActionManager* GetForProfile(Profile* profile) { return static_cast<ExtensionActionManager*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } static ExtensionActionManagerFactory* GetInstance(); @@ -40,11 +40,12 @@ class ExtensionActionManagerFactory : public ProfileKeyedServiceFactory { friend struct DefaultSingletonTraits<ExtensionActionManagerFactory>; ExtensionActionManagerFactory() - : ProfileKeyedServiceFactory("ExtensionActionManager", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ExtensionActionManager", + BrowserContextDependencyManager::GetInstance()) { } - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE { return new ExtensionActionManager(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/extension_action_manager.h b/chrome/browser/extensions/extension_action_manager.h index d314d2c..415d863 100644 --- a/chrome/browser/extensions/extension_action_manager.h +++ b/chrome/browser/extensions/extension_action_manager.h @@ -22,7 +22,7 @@ class Extension; // Owns the ExtensionActions associated with each extension. These actions live // while an extension is loaded and are destroyed on unload. -class ExtensionActionManager : public ProfileKeyedService, +class ExtensionActionManager : public BrowserContextKeyedService, public content::NotificationObserver { public: explicit ExtensionActionManager(Profile* profile); diff --git a/chrome/browser/extensions/extension_pref_value_map.h b/chrome/browser/extensions/extension_pref_value_map.h index bd60db9..38b61c2 100644 --- a/chrome/browser/extensions/extension_pref_value_map.h +++ b/chrome/browser/extensions/extension_pref_value_map.h @@ -53,7 +53,7 @@ // .reg_only = regular-only value // .inc = incognito value // Extension B has higher precedence than A. -class ExtensionPrefValueMap : public ProfileKeyedService { +class ExtensionPrefValueMap : public BrowserContextKeyedService { public: // Observer interface for monitoring ExtensionPrefValueMap. class Observer { @@ -75,7 +75,7 @@ class ExtensionPrefValueMap : public ProfileKeyedService { ExtensionPrefValueMap(); virtual ~ExtensionPrefValueMap(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // Set an extension preference |value| for |key| of extension |ext_id|. diff --git a/chrome/browser/extensions/extension_pref_value_map_factory.cc b/chrome/browser/extensions/extension_pref_value_map_factory.cc index 9356b8c..20966a7 100644 --- a/chrome/browser/extensions/extension_pref_value_map_factory.cc +++ b/chrome/browser/extensions/extension_pref_value_map_factory.cc @@ -9,9 +9,9 @@ #include "components/browser_context_keyed_service/browser_context_dependency_manager.h" ExtensionPrefValueMapFactory::ExtensionPrefValueMapFactory() - : ProfileKeyedServiceFactory( + : BrowserContextKeyedServiceFactory( "ExtensionPrefValueMap", - ProfileDependencyManager::GetInstance()) { + BrowserContextDependencyManager::GetInstance()) { } ExtensionPrefValueMapFactory::~ExtensionPrefValueMapFactory() { @@ -21,7 +21,7 @@ ExtensionPrefValueMapFactory::~ExtensionPrefValueMapFactory() { ExtensionPrefValueMap* ExtensionPrefValueMapFactory::GetForProfile( Profile* profile) { return static_cast<ExtensionPrefValueMap*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -29,7 +29,8 @@ ExtensionPrefValueMapFactory* ExtensionPrefValueMapFactory::GetInstance() { return Singleton<ExtensionPrefValueMapFactory>::get(); } -ProfileKeyedService* ExtensionPrefValueMapFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +ExtensionPrefValueMapFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new ExtensionPrefValueMap(); } diff --git a/chrome/browser/extensions/extension_pref_value_map_factory.h b/chrome/browser/extensions/extension_pref_value_map_factory.h index 96c21f0..8f6f194 100644 --- a/chrome/browser/extensions/extension_pref_value_map_factory.h +++ b/chrome/browser/extensions/extension_pref_value_map_factory.h @@ -11,7 +11,7 @@ class ExtensionPrefValueMap; class Profile; -class ExtensionPrefValueMapFactory : public ProfileKeyedServiceFactory { +class ExtensionPrefValueMapFactory : public BrowserContextKeyedServiceFactory { public: static ExtensionPrefValueMap* GetForProfile(Profile* profile); @@ -23,7 +23,7 @@ class ExtensionPrefValueMapFactory : public ProfileKeyedServiceFactory { ExtensionPrefValueMapFactory(); virtual ~ExtensionPrefValueMapFactory(); - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h index d9fa3de..73d7eef 100644 --- a/chrome/browser/extensions/extension_prefs.h +++ b/chrome/browser/extensions/extension_prefs.h @@ -52,7 +52,7 @@ class URLPatternSet; // maintains as the underlying extensions change. class ExtensionPrefs : public ContentSettingsStore::Observer, public ExtensionScopedPrefs, - public ProfileKeyedService { + public BrowserContextKeyedService { public: // Key name for a preference that keeps track of per-extension settings. This // is a dictionary object read from the Preferences file, keyed off of @@ -152,7 +152,7 @@ class ExtensionPrefs : public ContentSettingsStore::Observer, virtual ~ExtensionPrefs(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // Convenience function to get the ExtensionPrefs for a Profile. diff --git a/chrome/browser/extensions/extension_prefs_factory.cc b/chrome/browser/extensions/extension_prefs_factory.cc index 64eb11b..9b8a2d42 100644 --- a/chrome/browser/extensions/extension_prefs_factory.cc +++ b/chrome/browser/extensions/extension_prefs_factory.cc @@ -21,7 +21,7 @@ namespace extensions { // static ExtensionPrefs* ExtensionPrefsFactory::GetForProfile(Profile* profile) { return static_cast<ExtensionPrefs*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -35,14 +35,15 @@ void ExtensionPrefsFactory::SetInstanceForTesting( } ExtensionPrefsFactory::ExtensionPrefsFactory() - : ProfileKeyedServiceFactory("ExtensionPrefs", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ExtensionPrefs", + BrowserContextDependencyManager::GetInstance()) { } ExtensionPrefsFactory::~ExtensionPrefsFactory() { } -ProfileKeyedService* ExtensionPrefsFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* ExtensionPrefsFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = Profile::FromBrowserContext(context); bool extensions_disabled = diff --git a/chrome/browser/extensions/extension_prefs_factory.h b/chrome/browser/extensions/extension_prefs_factory.h index 3d8600b..b3057f2 100644 --- a/chrome/browser/extensions/extension_prefs_factory.h +++ b/chrome/browser/extensions/extension_prefs_factory.h @@ -13,7 +13,7 @@ namespace extensions { class ExtensionPrefs; -class ExtensionPrefsFactory : public ProfileKeyedServiceFactory { +class ExtensionPrefsFactory : public BrowserContextKeyedServiceFactory { public: static ExtensionPrefs* GetForProfile(Profile* profile); @@ -28,7 +28,7 @@ class ExtensionPrefsFactory : public ProfileKeyedServiceFactory { ExtensionPrefsFactory(); virtual ~ExtensionPrefsFactory(); - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/extensions/extension_system.h b/chrome/browser/extensions/extension_system.h index c5f084c..28c7b72 100644 --- a/chrome/browser/extensions/extension_system.h +++ b/chrome/browser/extensions/extension_system.h @@ -46,7 +46,7 @@ class UserScriptMaster; // and incognito Profiles, except as called out in comments. // This interface supports using TestExtensionSystem for TestingProfiles // that don't want all of the extensions baggage in their tests. -class ExtensionSystem : public ProfileKeyedService { +class ExtensionSystem : public BrowserContextKeyedService { public: ExtensionSystem(); virtual ~ExtensionSystem(); @@ -55,7 +55,7 @@ class ExtensionSystem : public ProfileKeyedService { // a convenience wrapper around ExtensionSystemFactory::GetForProfile. static ExtensionSystem* Get(Profile* profile); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE {} // Initializes extensions machinery. @@ -136,15 +136,15 @@ class ExtensionSystem : public ProfileKeyedService { // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl. // Implementation details: non-shared services are owned by -// ExtensionSystemImpl, a ProfileKeyedService with separate incognito -// instances. A private Shared class (also a ProfileKeyedService, +// ExtensionSystemImpl, a BrowserContextKeyedService with separate incognito +// instances. A private Shared class (also a BrowserContextKeyedService, // but with a shared instance for incognito) keeps the common services. class ExtensionSystemImpl : public ExtensionSystem { public: explicit ExtensionSystemImpl(Profile* profile); virtual ~ExtensionSystemImpl(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; @@ -184,7 +184,7 @@ class ExtensionSystemImpl : public ExtensionSystem { // Owns the Extension-related systems that have a single instance // shared between normal and incognito profiles. - class Shared : public ProfileKeyedService { + class Shared : public BrowserContextKeyedService { public: explicit Shared(Profile* profile); virtual ~Shared(); @@ -195,7 +195,7 @@ class ExtensionSystemImpl : public ExtensionSystem { void RegisterManagementPolicyProviders(); void Init(bool extensions_enabled); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; StateStore* state_store(); diff --git a/chrome/browser/extensions/extension_system_factory.cc b/chrome/browser/extensions/extension_system_factory.cc index a29c969..da11d75 100644 --- a/chrome/browser/extensions/extension_system_factory.cc +++ b/chrome/browser/extensions/extension_system_factory.cc @@ -21,7 +21,7 @@ namespace extensions { ExtensionSystemImpl::Shared* ExtensionSystemSharedFactory::GetForProfile(Profile* profile) { return static_cast<ExtensionSystemImpl::Shared*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -30,9 +30,9 @@ ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { } ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() - : ProfileKeyedServiceFactory( + : BrowserContextKeyedServiceFactory( "ExtensionSystemShared", - ProfileDependencyManager::GetInstance()) { + BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionPrefsFactory::GetInstance()); DependsOn(GlobalErrorServiceFactory::GetInstance()); #if defined(ENABLE_THEMES) @@ -44,7 +44,8 @@ ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { } -ProfileKeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +ExtensionSystemSharedFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new ExtensionSystemImpl::Shared(static_cast<Profile*>(profile)); } @@ -59,7 +60,7 @@ content::BrowserContext* ExtensionSystemSharedFactory::GetBrowserContextToUse( // static ExtensionSystem* ExtensionSystemFactory::GetForProfile(Profile* profile) { return static_cast<ExtensionSystem*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -68,16 +69,16 @@ ExtensionSystemFactory* ExtensionSystemFactory::GetInstance() { } ExtensionSystemFactory::ExtensionSystemFactory() - : ProfileKeyedServiceFactory( + : BrowserContextKeyedServiceFactory( "ExtensionSystem", - ProfileDependencyManager::GetInstance()) { + BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionSystemSharedFactory::GetInstance()); } ExtensionSystemFactory::~ExtensionSystemFactory() { } -ProfileKeyedService* ExtensionSystemFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* ExtensionSystemFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new ExtensionSystemImpl(static_cast<Profile*>(profile)); } @@ -87,7 +88,7 @@ content::BrowserContext* ExtensionSystemFactory::GetBrowserContextToUse( return chrome::GetBrowserContextOwnInstanceInIncognito(context); } -bool ExtensionSystemFactory::ServiceIsCreatedWithProfile() const { +bool ExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/extensions/extension_system_factory.h b/chrome/browser/extensions/extension_system_factory.h index 048df12..280db7a 100644 --- a/chrome/browser/extensions/extension_system_factory.h +++ b/chrome/browser/extensions/extension_system_factory.h @@ -9,15 +9,15 @@ #include "chrome/browser/extensions/extension_system.h" #include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" +class BrowserContextKeyedService; class Profile; -class ProfileKeyedService; namespace extensions { class ExtensionSystem; -// ProfileKeyedServiceFactory for ExtensionSystemImpl::Shared. +// BrowserContextKeyedServiceFactory for ExtensionSystemImpl::Shared. // Should not be used except by ExtensionSystem(Factory). -class ExtensionSystemSharedFactory : public ProfileKeyedServiceFactory { +class ExtensionSystemSharedFactory : public BrowserContextKeyedServiceFactory { public: static ExtensionSystemImpl::Shared* GetForProfile( Profile* profile); @@ -30,16 +30,16 @@ class ExtensionSystemSharedFactory : public ProfileKeyedServiceFactory { ExtensionSystemSharedFactory(); virtual ~ExtensionSystemSharedFactory(); - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; }; -// ProfileKeyedServiceFactory for ExtensionSystem. -class ExtensionSystemFactory : public ProfileKeyedServiceFactory { +// BrowserContextKeyedServiceFactory for ExtensionSystem. +class ExtensionSystemFactory : public BrowserContextKeyedServiceFactory { public: - // ProfileKeyedServiceFactory implementation: + // BrowserContextKeyedServiceFactory implementation: static ExtensionSystem* GetForProfile(Profile* profile); static ExtensionSystemFactory* GetInstance(); @@ -50,11 +50,11 @@ class ExtensionSystemFactory : public ProfileKeyedServiceFactory { ExtensionSystemFactory(); virtual ~ExtensionSystemFactory(); - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/extensions/image_loader.h b/chrome/browser/extensions/image_loader.h index 2932f46..de2b1d3 100644 --- a/chrome/browser/extensions/image_loader.h +++ b/chrome/browser/extensions/image_loader.h @@ -32,7 +32,7 @@ class Extension; // The views need to load their icons asynchronously might be deleted before // the images have loaded. If you pass your callback using a weak_ptr, this // will make sure the callback won't be called after the view is deleted. -class ImageLoader : public ProfileKeyedService { +class ImageLoader : public BrowserContextKeyedService { public: // Information about a singe image representation to load from an extension // resource. diff --git a/chrome/browser/extensions/image_loader_factory.cc b/chrome/browser/extensions/image_loader_factory.cc index ea60e0d..785d33c 100644 --- a/chrome/browser/extensions/image_loader_factory.cc +++ b/chrome/browser/extensions/image_loader_factory.cc @@ -14,14 +14,14 @@ namespace extensions { // static ImageLoader* ImageLoaderFactory::GetForProfile(Profile* profile) { return static_cast<ImageLoader*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static void ImageLoaderFactory::ResetForProfile(Profile* profile) { ImageLoaderFactory* factory = GetInstance(); - factory->ProfileShutdown(profile); - factory->ProfileDestroyed(profile); + factory->BrowserContextShutdown(profile); + factory->BrowserContextDestroyed(profile); } ImageLoaderFactory* ImageLoaderFactory::GetInstance() { @@ -29,19 +29,20 @@ ImageLoaderFactory* ImageLoaderFactory::GetInstance() { } ImageLoaderFactory::ImageLoaderFactory() - : ProfileKeyedServiceFactory("ImageLoader", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ImageLoader", + BrowserContextDependencyManager::GetInstance()) { } ImageLoaderFactory::~ImageLoaderFactory() { } -ProfileKeyedService* ImageLoaderFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* ImageLoaderFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new ImageLoader; } -bool ImageLoaderFactory::ServiceIsCreatedWithProfile() const { +bool ImageLoaderFactory::ServiceIsCreatedWithBrowserContext() const { return false; } diff --git a/chrome/browser/extensions/image_loader_factory.h b/chrome/browser/extensions/image_loader_factory.h index 5fa7e50..7548be0 100644 --- a/chrome/browser/extensions/image_loader_factory.h +++ b/chrome/browser/extensions/image_loader_factory.h @@ -17,7 +17,7 @@ class ImageLoader; // Singleton that owns all ImageLoaders and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated ImageLoader. -class ImageLoaderFactory : public ProfileKeyedServiceFactory { +class ImageLoaderFactory : public BrowserContextKeyedServiceFactory { public: static ImageLoader* GetForProfile(Profile* profile); @@ -31,10 +31,10 @@ class ImageLoaderFactory : public ProfileKeyedServiceFactory { ImageLoaderFactory(); virtual ~ImageLoaderFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; }; diff --git a/chrome/browser/extensions/install_tracker.h b/chrome/browser/extensions/install_tracker.h index d3e94a4..c8b2c47 100644 --- a/chrome/browser/extensions/install_tracker.h +++ b/chrome/browser/extensions/install_tracker.h @@ -22,7 +22,7 @@ namespace extensions { class ExtensionPrefs; -class InstallTracker : public ProfileKeyedService, +class InstallTracker : public BrowserContextKeyedService, public content::NotificationObserver { public: InstallTracker(Profile* profile, @@ -42,7 +42,7 @@ class InstallTracker : public ProfileKeyedService, int percent_downloaded); void OnInstallFailure(const std::string& extension_id); - // Overriddes for ProfileKeyedService: + // Overriddes for BrowserContextKeyedService: virtual void Shutdown() OVERRIDE; // content::NotificationObserver diff --git a/chrome/browser/extensions/install_tracker_factory.cc b/chrome/browser/extensions/install_tracker_factory.cc index d824925..5b03b7e 100644 --- a/chrome/browser/extensions/install_tracker_factory.cc +++ b/chrome/browser/extensions/install_tracker_factory.cc @@ -18,7 +18,7 @@ namespace extensions { // static InstallTracker* InstallTrackerFactory::GetForProfile(Profile* profile) { return static_cast<InstallTracker*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } InstallTrackerFactory* InstallTrackerFactory::GetInstance() { @@ -26,15 +26,16 @@ InstallTrackerFactory* InstallTrackerFactory::GetInstance() { } InstallTrackerFactory::InstallTrackerFactory() - : ProfileKeyedServiceFactory("InstallTracker", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "InstallTracker", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ExtensionSystemFactory::GetInstance()); } InstallTrackerFactory::~InstallTrackerFactory() { } -ProfileKeyedService* InstallTrackerFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* InstallTrackerFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); ExtensionService* service = diff --git a/chrome/browser/extensions/install_tracker_factory.h b/chrome/browser/extensions/install_tracker_factory.h index 1ec3bc3..938a6aa 100644 --- a/chrome/browser/extensions/install_tracker_factory.h +++ b/chrome/browser/extensions/install_tracker_factory.h @@ -15,7 +15,7 @@ namespace extensions { class InstallTracker; -class InstallTrackerFactory : public ProfileKeyedServiceFactory { +class InstallTrackerFactory : public BrowserContextKeyedServiceFactory { public: static InstallTracker* GetForProfile(Profile* profile); static InstallTrackerFactory* GetInstance(); @@ -26,8 +26,8 @@ class InstallTrackerFactory : public ProfileKeyedServiceFactory { InstallTrackerFactory(); virtual ~InstallTrackerFactory(); - // ProfileKeyedServiceFactory overrides: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory overrides: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/extensions/menu_manager_unittest.cc b/chrome/browser/extensions/menu_manager_unittest.cc index bd60d8c..27f0020 100644 --- a/chrome/browser/extensions/menu_manager_unittest.cc +++ b/chrome/browser/extensions/menu_manager_unittest.cc @@ -489,7 +489,7 @@ class MockExtensionSystem : public TestExtensionSystem { DISALLOW_COPY_AND_ASSIGN(MockExtensionSystem); }; -ProfileKeyedService* BuildMockExtensionSystem( +BrowserContextKeyedService* BuildMockExtensionSystem( content::BrowserContext* profile) { return new MockExtensionSystem(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/shell_window_registry.cc b/chrome/browser/extensions/shell_window_registry.cc index 85af8e7..05fd993 100644 --- a/chrome/browser/extensions/shell_window_registry.cc +++ b/chrome/browser/extensions/shell_window_registry.cc @@ -256,7 +256,7 @@ void ShellWindowRegistry::BringToFront(ShellWindow* shell_window) { ShellWindowRegistry* ShellWindowRegistry::Factory::GetForProfile( Profile* profile, bool create) { return static_cast<ShellWindowRegistry*>( - GetInstance()->GetServiceForProfile(profile, create)); + GetInstance()->GetServiceForBrowserContext(profile, create)); } ShellWindowRegistry::Factory* ShellWindowRegistry::Factory::GetInstance() { @@ -264,19 +264,21 @@ ShellWindowRegistry::Factory* ShellWindowRegistry::Factory::GetInstance() { } ShellWindowRegistry::Factory::Factory() - : ProfileKeyedServiceFactory("ShellWindowRegistry", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ShellWindowRegistry", + BrowserContextDependencyManager::GetInstance()) { } ShellWindowRegistry::Factory::~Factory() { } -ProfileKeyedService* ShellWindowRegistry::Factory::BuildServiceInstanceFor( +BrowserContextKeyedService* +ShellWindowRegistry::Factory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new ShellWindowRegistry(static_cast<Profile*>(profile)); } -bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() const { +bool ShellWindowRegistry::Factory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/extensions/shell_window_registry.h b/chrome/browser/extensions/shell_window_registry.h index ad255cf..ba3dd76 100644 --- a/chrome/browser/extensions/shell_window_registry.h +++ b/chrome/browser/extensions/shell_window_registry.h @@ -32,7 +32,7 @@ namespace extensions { // page, shell windows, tray view, panels etc.) and other app level behaviour // (e.g. notifications the app is interested in, lifetime of the background // page). -class ShellWindowRegistry : public ProfileKeyedService { +class ShellWindowRegistry : public BrowserContextKeyedService { public: class Observer { public: @@ -100,7 +100,7 @@ class ShellWindowRegistry : public ProfileKeyedService { // ShellWindow::WindowType, or 0 for any window type. static bool IsShellWindowRegisteredInAnyProfile(int window_type_mask); - class Factory : public ProfileKeyedServiceFactory { + class Factory : public BrowserContextKeyedServiceFactory { public: static ShellWindowRegistry* GetForProfile(Profile* profile, bool create); @@ -111,10 +111,10 @@ class ShellWindowRegistry : public ProfileKeyedService { Factory(); virtual ~Factory(); - // ProfileKeyedServiceFactory - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/extensions/test_extension_system.cc b/chrome/browser/extensions/test_extension_system.cc index 938e6b3..005b460 100644 --- a/chrome/browser/extensions/test_extension_system.cc +++ b/chrome/browser/extensions/test_extension_system.cc @@ -175,7 +175,7 @@ const OneShotEvent& TestExtensionSystem::ready() const { } // static -ProfileKeyedService* TestExtensionSystem::Build( +BrowserContextKeyedService* TestExtensionSystem::Build( content::BrowserContext* profile) { return new TestExtensionSystem(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/test_extension_system.h b/chrome/browser/extensions/test_extension_system.h index cc57886..287f5c9 100644 --- a/chrome/browser/extensions/test_extension_system.h +++ b/chrome/browser/extensions/test_extension_system.h @@ -27,7 +27,7 @@ class TestExtensionSystem : public ExtensionSystem { explicit TestExtensionSystem(Profile* profile); virtual ~TestExtensionSystem(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // Creates an ExtensionPrefs with the testing profile and returns it. @@ -72,7 +72,7 @@ class TestExtensionSystem : public ExtensionSystem { virtual const OneShotEvent& ready() const OVERRIDE; // Factory method for tests to use with SetTestingProfile. - static ProfileKeyedService* Build(content::BrowserContext* profile); + static BrowserContextKeyedService* Build(content::BrowserContext* profile); protected: Profile* profile_; diff --git a/chrome/browser/extensions/token_cache/token_cache_service.h b/chrome/browser/extensions/token_cache/token_cache_service.h index fab1be4..70ee415 100644 --- a/chrome/browser/extensions/token_cache/token_cache_service.h +++ b/chrome/browser/extensions/token_cache/token_cache_service.h @@ -26,7 +26,7 @@ namespace extensions { // This class caches tokens for the current user. It will clear tokens out // when the user logs out or after the specified timeout interval, or when // the instance of chrome shuts down. -class TokenCacheService : public ProfileKeyedService, +class TokenCacheService : public BrowserContextKeyedService, public content::NotificationObserver { public: explicit TokenCacheService(Profile* profile); diff --git a/chrome/browser/extensions/token_cache/token_cache_service_factory.cc b/chrome/browser/extensions/token_cache/token_cache_service_factory.cc index a68c879..1c09aec 100644 --- a/chrome/browser/extensions/token_cache/token_cache_service_factory.cc +++ b/chrome/browser/extensions/token_cache/token_cache_service_factory.cc @@ -13,7 +13,7 @@ extensions::TokenCacheService* TokenCacheServiceFactory::GetForProfile(Profile* profile) { return static_cast<extensions::TokenCacheService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -22,14 +22,15 @@ TokenCacheServiceFactory* TokenCacheServiceFactory::GetInstance() { } TokenCacheServiceFactory::TokenCacheServiceFactory() - : ProfileKeyedServiceFactory("TokenCacheService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "TokenCacheService", + BrowserContextDependencyManager::GetInstance()) { } TokenCacheServiceFactory::~TokenCacheServiceFactory() { } -ProfileKeyedService* TokenCacheServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* TokenCacheServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new extensions::TokenCacheService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/token_cache/token_cache_service_factory.h b/chrome/browser/extensions/token_cache/token_cache_service_factory.h index c1beeda..3767fe3 100644 --- a/chrome/browser/extensions/token_cache/token_cache_service_factory.h +++ b/chrome/browser/extensions/token_cache/token_cache_service_factory.h @@ -15,7 +15,7 @@ namespace extensions { class TokenCacheService; } // namespace extensions -class TokenCacheServiceFactory : public ProfileKeyedServiceFactory { +class TokenCacheServiceFactory : public BrowserContextKeyedServiceFactory { public: static extensions::TokenCacheService* GetForProfile(Profile* profile); static TokenCacheServiceFactory* GetInstance(); @@ -26,8 +26,8 @@ class TokenCacheServiceFactory : public ProfileKeyedServiceFactory { friend struct DefaultSingletonTraits<TokenCacheServiceFactory>; - // Inherited from ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // Inherited from BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(TokenCacheServiceFactory); diff --git a/chrome/browser/favicon/favicon_handler_unittest.cc b/chrome/browser/favicon/favicon_handler_unittest.cc index 191f502..52dbb7a 100644 --- a/chrome/browser/favicon/favicon_handler_unittest.cc +++ b/chrome/browser/favicon/favicon_handler_unittest.cc @@ -1029,7 +1029,7 @@ TEST_F(FaviconHandlerTest, FirstFavicon) { handler.GetEntry()->GetFavicon().image.ToSkBitmap()->width()); } -static ProfileKeyedService* BuildFaviconService( +static BrowserContextKeyedService* BuildFaviconService( content::BrowserContext* profile) { return new FaviconService(NULL); } diff --git a/chrome/browser/favicon/favicon_service.h b/chrome/browser/favicon/favicon_service.h index 5705ab2..b87de29 100644 --- a/chrome/browser/favicon/favicon_service.h +++ b/chrome/browser/favicon/favicon_service.h @@ -32,7 +32,7 @@ struct FaviconImageResult; // This service is thread safe. Each request callback is invoked in the // thread that made the request. class FaviconService : public CancelableRequestProvider, - public ProfileKeyedService { + public BrowserContextKeyedService { public: explicit FaviconService(HistoryService* history_service); diff --git a/chrome/browser/favicon/favicon_service_factory.cc b/chrome/browser/favicon/favicon_service_factory.cc index 6b3702f..fce9098 100644 --- a/chrome/browser/favicon/favicon_service_factory.cc +++ b/chrome/browser/favicon/favicon_service_factory.cc @@ -17,11 +17,11 @@ FaviconService* FaviconServiceFactory::GetForProfile( Profile* profile, Profile::ServiceAccessType sat) { if (!profile->IsOffTheRecord()) { return static_cast<FaviconService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } else if (sat == Profile::EXPLICIT_ACCESS) { // Profile must be OffTheRecord in this case. return static_cast<FaviconService*>( - GetInstance()->GetServiceForProfile( + GetInstance()->GetServiceForBrowserContext( profile->GetOriginalProfile(), true)); } @@ -36,14 +36,15 @@ FaviconServiceFactory* FaviconServiceFactory::GetInstance() { } FaviconServiceFactory::FaviconServiceFactory() - : ProfileKeyedServiceFactory("FaviconService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "FaviconService", + BrowserContextDependencyManager::GetInstance()) { DependsOn(HistoryServiceFactory::GetInstance()); } FaviconServiceFactory::~FaviconServiceFactory() {} -ProfileKeyedService* FaviconServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* FaviconServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { HistoryService* history_service = HistoryServiceFactory::GetForProfile( static_cast<Profile*>(profile), Profile::EXPLICIT_ACCESS); diff --git a/chrome/browser/favicon/favicon_service_factory.h b/chrome/browser/favicon/favicon_service_factory.h index f2d63c1..42f76b4 100644 --- a/chrome/browser/favicon/favicon_service_factory.h +++ b/chrome/browser/favicon/favicon_service_factory.h @@ -16,7 +16,7 @@ class FaviconService; // Singleton that owns all FaviconService and associates them with // Profiles. -class FaviconServiceFactory : public ProfileKeyedServiceFactory { +class FaviconServiceFactory : public BrowserContextKeyedServiceFactory { public: // |access| defines what the caller plans to do with the service. See // the ServiceAccessType definition in profile.h. @@ -31,8 +31,8 @@ class FaviconServiceFactory : public ProfileKeyedServiceFactory { FaviconServiceFactory(); virtual ~FaviconServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc index 48ec458..7611658 100644 --- a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc +++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc @@ -17,7 +17,7 @@ namespace { -class Service : public ProfileKeyedService { +class Service : public BrowserContextKeyedService { public: explicit Service(Profile* profile) { #if defined(OS_ANDROID) @@ -47,7 +47,7 @@ class Service : public ProfileKeyedService { ChromeGeolocationPermissionContext* ChromeGeolocationPermissionContextFactory::GetForProfile(Profile* profile) { return static_cast<Service*>( - GetInstance()->GetServiceForProfile(profile, true))->context(); + GetInstance()->GetServiceForBrowserContext(profile, true))->context(); } // static @@ -58,16 +58,16 @@ ChromeGeolocationPermissionContextFactory::GetInstance() { ChromeGeolocationPermissionContextFactory:: ChromeGeolocationPermissionContextFactory() - : ProfileKeyedServiceFactory( + : BrowserContextKeyedServiceFactory( "ChromeGeolocationPermissionContext", - ProfileDependencyManager::GetInstance()) { + BrowserContextDependencyManager::GetInstance()) { } ChromeGeolocationPermissionContextFactory:: ~ChromeGeolocationPermissionContextFactory() { } -ProfileKeyedService* +BrowserContextKeyedService* ChromeGeolocationPermissionContextFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new Service(static_cast<Profile*>(profile)); diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h index a8d3bb9..3b03442 100644 --- a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h +++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h @@ -15,7 +15,7 @@ class PrefRegistrySyncable; class Profile; class ChromeGeolocationPermissionContextFactory - : public ProfileKeyedServiceFactory { + : public BrowserContextKeyedServiceFactory { public: static ChromeGeolocationPermissionContext* GetForProfile(Profile* profile); @@ -28,8 +28,8 @@ class ChromeGeolocationPermissionContextFactory ChromeGeolocationPermissionContextFactory(); virtual ~ChromeGeolocationPermissionContextFactory(); - // |ProfileKeyedBaseFactory| methods: - virtual ProfileKeyedService* + // |BrowserContextKeyedBaseFactory| methods: + virtual BrowserContextKeyedService* BuildServiceInstanceFor(content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; diff --git a/chrome/browser/google/google_url_tracker.h b/chrome/browser/google/google_url_tracker.h index 9b7d43b..6b2d07e 100644 --- a/chrome/browser/google/google_url_tracker.h +++ b/chrome/browser/google/google_url_tracker.h @@ -43,7 +43,7 @@ class NavigationController; // RequestServerCheck(). class GoogleURLTracker : public net::URLFetcherDelegate, public net::NetworkChangeNotifier::IPAddressObserver, - public ProfileKeyedService { + public BrowserContextKeyedService { public: // The contents of the Details for a NOTIFICATION_GOOGLE_URL_UPDATED. typedef std::pair<GURL, GURL> UpdatedDetails; @@ -134,7 +134,7 @@ class GoogleURLTracker : public net::URLFetcherDelegate, // NetworkChangeNotifier::IPAddressObserver: virtual void OnIPAddressChanged() OVERRIDE; - // ProfileKeyedService: + // BrowserContextKeyedService: virtual void Shutdown() OVERRIDE; // Registers consumer interest in getting an updated URL from the server. diff --git a/chrome/browser/google/google_url_tracker_factory.cc b/chrome/browser/google/google_url_tracker_factory.cc index 3854344..8f82b05 100644 --- a/chrome/browser/google/google_url_tracker_factory.cc +++ b/chrome/browser/google/google_url_tracker_factory.cc @@ -17,7 +17,7 @@ // static GoogleURLTracker* GoogleURLTrackerFactory::GetForProfile(Profile* profile) { return static_cast<GoogleURLTracker*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -26,14 +26,15 @@ GoogleURLTrackerFactory* GoogleURLTrackerFactory::GetInstance() { } GoogleURLTrackerFactory::GoogleURLTrackerFactory() - : ProfileKeyedServiceFactory("GoogleURLTracker", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "GoogleURLTracker", + BrowserContextDependencyManager::GetInstance()) { } GoogleURLTrackerFactory::~GoogleURLTrackerFactory() { } -ProfileKeyedService* GoogleURLTrackerFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* GoogleURLTrackerFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { scoped_ptr<GoogleURLTrackerNavigationHelper> nav_helper( new GoogleURLTrackerNavigationHelperImpl()); @@ -58,7 +59,7 @@ content::BrowserContext* GoogleURLTrackerFactory::GetBrowserContextToUse( return chrome::GetBrowserContextRedirectedInIncognito(context); } -bool GoogleURLTrackerFactory::ServiceIsCreatedWithProfile() const { +bool GoogleURLTrackerFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/google/google_url_tracker_factory.h b/chrome/browser/google/google_url_tracker_factory.h index 7a87dd6..d1eecf0 100644 --- a/chrome/browser/google/google_url_tracker_factory.h +++ b/chrome/browser/google/google_url_tracker_factory.h @@ -13,7 +13,7 @@ class GoogleURLTracker; class Profile; // Singleton that owns all GoogleURLTrackers and associates them with Profiles. -class GoogleURLTrackerFactory : public ProfileKeyedServiceFactory { +class GoogleURLTrackerFactory : public BrowserContextKeyedServiceFactory { public: // Returns the GoogleURLTracker for |profile|. This may return NULL for a // testing profile. @@ -27,14 +27,14 @@ class GoogleURLTrackerFactory : public ProfileKeyedServiceFactory { GoogleURLTrackerFactory(); virtual ~GoogleURLTrackerFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerFactory); diff --git a/chrome/browser/google/google_url_tracker_unittest.cc b/chrome/browser/google/google_url_tracker_unittest.cc index 7d6df99..91bb0a5 100644 --- a/chrome/browser/google/google_url_tracker_unittest.cc +++ b/chrome/browser/google/google_url_tracker_unittest.cc @@ -285,7 +285,8 @@ void GoogleURLTrackerTest::OnInfoBarClosed(InfoBarDelegate* infobar, GoogleURLTrackerTest::GoogleURLTrackerTest() : message_loop_(MessageLoop::TYPE_IO), io_thread_(content::BrowserThread::IO, &message_loop_) { - GoogleURLTrackerFactory::GetInstance()->RegisterUserPrefsOnProfile(&profile_); + GoogleURLTrackerFactory::GetInstance()->RegisterUserPrefsOnBrowserContext( + &profile_); } GoogleURLTrackerTest::~GoogleURLTrackerTest() { diff --git a/chrome/browser/google_apis/drive_notification_manager.h b/chrome/browser/google_apis/drive_notification_manager.h index da63aeb..b2b9109 100644 --- a/chrome/browser/google_apis/drive_notification_manager.h +++ b/chrome/browser/google_apis/drive_notification_manager.h @@ -22,13 +22,13 @@ namespace google_apis { // 1. XMPP invalidation is received from Google Drive. // 2. Polling timer counts down. class DriveNotificationManager - : public ProfileKeyedService, + : public BrowserContextKeyedService, public syncer::InvalidationHandler { public: explicit DriveNotificationManager(Profile* profile); virtual ~DriveNotificationManager(); - // ProfileKeyedService override. + // BrowserContextKeyedService override. virtual void Shutdown() OVERRIDE; // syncer::InvalidationHandler implementation. diff --git a/chrome/browser/google_apis/drive_notification_manager_factory.cc b/chrome/browser/google_apis/drive_notification_manager_factory.cc index 0d77ea7..9c28800 100644 --- a/chrome/browser/google_apis/drive_notification_manager_factory.cc +++ b/chrome/browser/google_apis/drive_notification_manager_factory.cc @@ -19,7 +19,7 @@ DriveNotificationManagerFactory::GetForProfile(Profile* profile) { return NULL; return static_cast<DriveNotificationManager*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -29,14 +29,16 @@ DriveNotificationManagerFactory::GetInstance() { } DriveNotificationManagerFactory::DriveNotificationManagerFactory() - : ProfileKeyedServiceFactory("DriveNotificationManager", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "DriveNotificationManager", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ProfileSyncServiceFactory::GetInstance()); } DriveNotificationManagerFactory::~DriveNotificationManagerFactory() {} -ProfileKeyedService* DriveNotificationManagerFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +DriveNotificationManagerFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new DriveNotificationManager(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/google_apis/drive_notification_manager_factory.h b/chrome/browser/google_apis/drive_notification_manager_factory.h index 76f2c72..6c1bddf 100644 --- a/chrome/browser/google_apis/drive_notification_manager_factory.h +++ b/chrome/browser/google_apis/drive_notification_manager_factory.h @@ -16,7 +16,8 @@ class DriveNotificationManager; // Singleton that owns all DriveNotificationManager and associates them with // profiles. -class DriveNotificationManagerFactory : public ProfileKeyedServiceFactory { +class DriveNotificationManagerFactory + : public BrowserContextKeyedServiceFactory { public: static DriveNotificationManager* GetForProfile(Profile* profile); @@ -28,8 +29,8 @@ class DriveNotificationManagerFactory : public ProfileKeyedServiceFactory { DriveNotificationManagerFactory(); virtual ~DriveNotificationManagerFactory(); - // ProfileKeyedServiceFactory implementation. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory implementation. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/history/history_service.h b/chrome/browser/history/history_service.h index 2e25677..1f698a4 100644 --- a/chrome/browser/history/history_service.h +++ b/chrome/browser/history/history_service.h @@ -84,7 +84,7 @@ struct HistoryDetails; class HistoryService : public CancelableRequestProvider, public content::NotificationObserver, public syncer::SyncableService, - public ProfileKeyedService, + public BrowserContextKeyedService, public visitedlink::VisitedLinkDelegate { public: // Miscellaneous commonly-used types. @@ -168,7 +168,7 @@ class HistoryService : public CancelableRequestProvider, return in_memory_url_index_.get(); } - // ProfileKeyedService: + // BrowserContextKeyedService: virtual void Shutdown() OVERRIDE; // Navigation ---------------------------------------------------------------- diff --git a/chrome/browser/history/history_service_factory.cc b/chrome/browser/history/history_service_factory.cc index 615457a..c33a7fa 100644 --- a/chrome/browser/history/history_service_factory.cc +++ b/chrome/browser/history/history_service_factory.cc @@ -21,7 +21,7 @@ HistoryService* HistoryServiceFactory::GetForProfile( return NULL; return static_cast<HistoryService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -34,14 +34,14 @@ HistoryServiceFactory::GetForProfileIfExists( return NULL; return static_cast<HistoryService*>( - GetInstance()->GetServiceForProfile(profile, false)); + GetInstance()->GetServiceForBrowserContext(profile, false)); } // static HistoryService* HistoryServiceFactory::GetForProfileWithoutCreating(Profile* profile) { return static_cast<HistoryService*>( - GetInstance()->GetServiceForProfile(profile, false)); + GetInstance()->GetServiceForBrowserContext(profile, false)); } // static @@ -52,19 +52,19 @@ HistoryServiceFactory* HistoryServiceFactory::GetInstance() { // static void HistoryServiceFactory::ShutdownForProfile(Profile* profile) { HistoryServiceFactory* factory = GetInstance(); - factory->ProfileDestroyed(profile); + factory->BrowserContextDestroyed(profile); } HistoryServiceFactory::HistoryServiceFactory() - : ProfileKeyedServiceFactory( - "HistoryService", ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "HistoryService", BrowserContextDependencyManager::GetInstance()) { DependsOn(BookmarkModelFactory::GetInstance()); } HistoryServiceFactory::~HistoryServiceFactory() { } -ProfileKeyedService* +BrowserContextKeyedService* HistoryServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); diff --git a/chrome/browser/history/history_service_factory.h b/chrome/browser/history/history_service_factory.h index c66a02b..6d8cc42 100644 --- a/chrome/browser/history/history_service_factory.h +++ b/chrome/browser/history/history_service_factory.h @@ -13,7 +13,7 @@ class HistoryService; // Singleton that owns all HistoryService and associates them with // Profiles. -class HistoryServiceFactory : public ProfileKeyedServiceFactory { +class HistoryServiceFactory : public BrowserContextKeyedServiceFactory { public: static HistoryService* GetForProfile( Profile* profile, Profile::ServiceAccessType sat); @@ -38,8 +38,8 @@ class HistoryServiceFactory : public ProfileKeyedServiceFactory { HistoryServiceFactory(); virtual ~HistoryServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/history/shortcuts_backend.h b/chrome/browser/history/shortcuts_backend.h index 7e46ace..b745f0a 100644 --- a/chrome/browser/history/shortcuts_backend.h +++ b/chrome/browser/history/shortcuts_backend.h @@ -31,7 +31,7 @@ class ShortcutsDatabase; // This class manages the shortcut provider backend - access to database on the // db thread, etc. -class ShortcutsBackend : public RefcountedProfileKeyedService, +class ShortcutsBackend : public RefcountedBrowserContextKeyedService, public content::NotificationObserver { public: // The following struct encapsulates one previously selected omnibox shortcut. @@ -142,7 +142,7 @@ class ShortcutsBackend : public RefcountedProfileKeyedService, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; - // RefcountedProfileKeyedService + // RefcountedBrowserContextKeyedService virtual void ShutdownOnUIThread() OVERRIDE; enum CurrentState { diff --git a/chrome/browser/history/shortcuts_backend_factory.cc b/chrome/browser/history/shortcuts_backend_factory.cc index 6496224..e532455 100644 --- a/chrome/browser/history/shortcuts_backend_factory.cc +++ b/chrome/browser/history/shortcuts_backend_factory.cc @@ -16,14 +16,14 @@ using history::ShortcutsBackend; scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfile( Profile* profile) { return static_cast<ShortcutsBackend*>( - GetInstance()->GetServiceForProfile(profile, true).get()); + GetInstance()->GetServiceForBrowserContext(profile, true).get()); } // static scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfileIfExists( Profile* profile) { return static_cast<ShortcutsBackend*>( - GetInstance()->GetServiceForProfile(profile, false).get()); + GetInstance()->GetServiceForBrowserContext(profile, false).get()); } // static @@ -32,7 +32,7 @@ ShortcutsBackendFactory* ShortcutsBackendFactory::GetInstance() { } // static -scoped_refptr<RefcountedProfileKeyedService> +scoped_refptr<RefcountedBrowserContextKeyedService> ShortcutsBackendFactory::BuildProfileForTesting( content::BrowserContext* profile) { scoped_refptr<history::ShortcutsBackend> backend( @@ -43,7 +43,7 @@ ShortcutsBackendFactory::BuildProfileForTesting( } // static -scoped_refptr<RefcountedProfileKeyedService> +scoped_refptr<RefcountedBrowserContextKeyedService> ShortcutsBackendFactory::BuildProfileNoDatabaseForTesting( content::BrowserContext* profile) { scoped_refptr<history::ShortcutsBackend> backend( @@ -54,14 +54,14 @@ ShortcutsBackendFactory::BuildProfileNoDatabaseForTesting( } ShortcutsBackendFactory::ShortcutsBackendFactory() - : RefcountedProfileKeyedServiceFactory( + : RefcountedBrowserContextKeyedServiceFactory( "ShortcutsBackend", - ProfileDependencyManager::GetInstance()) { + BrowserContextDependencyManager::GetInstance()) { } ShortcutsBackendFactory::~ShortcutsBackendFactory() {} -scoped_refptr<RefcountedProfileKeyedService> +scoped_refptr<RefcountedBrowserContextKeyedService> ShortcutsBackendFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { scoped_refptr<history::ShortcutsBackend> backend( diff --git a/chrome/browser/history/shortcuts_backend_factory.h b/chrome/browser/history/shortcuts_backend_factory.h index 78ee888..d56c558 100644 --- a/chrome/browser/history/shortcuts_backend_factory.h +++ b/chrome/browser/history/shortcuts_backend_factory.h @@ -17,7 +17,8 @@ class ShortcutsBackend; // Singleton that owns all instances of ShortcutsBackend and associates them // with Profiles. -class ShortcutsBackendFactory : public RefcountedProfileKeyedServiceFactory { +class ShortcutsBackendFactory + : public RefcountedBrowserContextKeyedServiceFactory { public: static scoped_refptr<history::ShortcutsBackend> GetForProfile( Profile* profile); @@ -28,12 +29,12 @@ class ShortcutsBackendFactory : public RefcountedProfileKeyedServiceFactory { static ShortcutsBackendFactory* GetInstance(); // Creates and returns a backend for testing purposes. - static scoped_refptr<RefcountedProfileKeyedService> + static scoped_refptr<RefcountedBrowserContextKeyedService> BuildProfileForTesting(content::BrowserContext* profile); // Creates and returns a backend but without creating its persistent database // for testing purposes. - static scoped_refptr<RefcountedProfileKeyedService> + static scoped_refptr<RefcountedBrowserContextKeyedService> BuildProfileNoDatabaseForTesting(content::BrowserContext* profile); private: @@ -42,9 +43,9 @@ class ShortcutsBackendFactory : public RefcountedProfileKeyedServiceFactory { ShortcutsBackendFactory(); virtual ~ShortcutsBackendFactory(); - // ProfileKeyedServiceFactory: - virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - content::BrowserContext* profile) const OVERRIDE; + // BrowserContextKeyedServiceFactory: + virtual scoped_refptr<RefcountedBrowserContextKeyedService> + BuildServiceInstanceFor(content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/history/web_history_service.h b/chrome/browser/history/web_history_service.h index 55d0e99fca..dceb815 100644 --- a/chrome/browser/history/web_history_service.h +++ b/chrome/browser/history/web_history_service.h @@ -22,7 +22,7 @@ namespace history { // Provides an API for querying Google servers for a signed-in user's // synced history visits. It is roughly analogous to HistoryService, and // supports a similar API. -class WebHistoryService : public ProfileKeyedService { +class WebHistoryService : public BrowserContextKeyedService { public: // Handles all the work of making an API request. This class encapsulates // the entire state of the request. When an instance is destroyed, all diff --git a/chrome/browser/history/web_history_service_factory.cc b/chrome/browser/history/web_history_service_factory.cc index 397d6ea..e922bc0 100644 --- a/chrome/browser/history/web_history_service_factory.cc +++ b/chrome/browser/history/web_history_service_factory.cc @@ -40,12 +40,12 @@ history::WebHistoryService* WebHistoryServiceFactory::GetForProfile( Profile* profile) { if (IsHistorySyncEnabled(profile)) { return static_cast<history::WebHistoryService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } return NULL; } -ProfileKeyedService* WebHistoryServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* WebHistoryServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); @@ -56,8 +56,9 @@ ProfileKeyedService* WebHistoryServiceFactory::BuildServiceInstanceFor( } WebHistoryServiceFactory::WebHistoryServiceFactory() - : ProfileKeyedServiceFactory("WebHistoryServiceFactory", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "WebHistoryServiceFactory", + BrowserContextDependencyManager::GetInstance()) { DependsOn(TokenServiceFactory::GetInstance()); DependsOn(CookieSettings::Factory::GetInstance()); } diff --git a/chrome/browser/history/web_history_service_factory.h b/chrome/browser/history/web_history_service_factory.h index 64fb30a..3de9079b 100644 --- a/chrome/browser/history/web_history_service_factory.h +++ b/chrome/browser/history/web_history_service_factory.h @@ -15,7 +15,7 @@ class WebHistoryService; // Used for creating and fetching a per-profile instance of the // WebHistoryService. -class WebHistoryServiceFactory : public ProfileKeyedServiceFactory { +class WebHistoryServiceFactory : public BrowserContextKeyedServiceFactory { public: // Get the singleton instance of the factory. static WebHistoryServiceFactory* GetInstance(); @@ -24,8 +24,8 @@ class WebHistoryServiceFactory : public ProfileKeyedServiceFactory { static history::WebHistoryService* GetForProfile(Profile* profile); protected: - // Overridden from ProfileKeyedServiceFactory. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // Overridden from BrowserContextKeyedServiceFactory. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; private: diff --git a/chrome/browser/invalidation/invalidation_frontend.h b/chrome/browser/invalidation/invalidation_frontend.h index 8344e27..f8b61a5 100644 --- a/chrome/browser/invalidation/invalidation_frontend.h +++ b/chrome/browser/invalidation/invalidation_frontend.h @@ -45,7 +45,7 @@ namespace invalidation { // It is an error to have registered handlers when an InvalidationFrontend is // shut down; clients must ensure that they unregister themselves before then. // -// TODO(rlarocque): This class should extend ProfileKeyedService. +// TODO(rlarocque): This class should extend BrowserContextKeyedService. // // NOTE(akalin): Invalidations that come in during browser shutdown may get // dropped. This won't matter once we have an Acknowledge API, though: see diff --git a/chrome/browser/invalidation/invalidation_service_android.h b/chrome/browser/invalidation/invalidation_service_android.h index f7452ef..6daef6a 100644 --- a/chrome/browser/invalidation/invalidation_service_android.h +++ b/chrome/browser/invalidation/invalidation_service_android.h @@ -24,7 +24,7 @@ namespace invalidation { // around Android's invalidations service. class InvalidationServiceAndroid : public base::NonThreadSafe, - public ProfileKeyedService, + public BrowserContextKeyedService, public InvalidationFrontend, public content::NotificationObserver { public: diff --git a/chrome/browser/invalidation/invalidation_service_factory.cc b/chrome/browser/invalidation/invalidation_service_factory.cc index d5d3b17..0fa857b 100644 --- a/chrome/browser/invalidation/invalidation_service_factory.cc +++ b/chrome/browser/invalidation/invalidation_service_factory.cc @@ -19,12 +19,12 @@ class TokenService; namespace invalidation { // TODO(rlarocque): Re-enable this once InvalidationFrontend can -// extend ProfileKeyedService. +// extend BrowserContextKeyedService. // // static // InvalidationFrontend* InvalidationServiceFactory::GetForProfile( // Profile* profile) { // return static_cast<InvalidationFrontend*>( -// GetInstance()->GetServiceForProfile(profile, true)); +// GetInstance()->GetServiceForBrowserContext(profile, true)); // } // static @@ -33,8 +33,9 @@ InvalidationServiceFactory* InvalidationServiceFactory::GetInstance() { } InvalidationServiceFactory::InvalidationServiceFactory() - : ProfileKeyedServiceFactory("InvalidationService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "InvalidationService", + BrowserContextDependencyManager::GetInstance()) { #if !defined(OS_ANDROID) DependsOn(SigninManagerFactory::GetInstance()); DependsOn(TokenServiceFactory::GetInstance()); @@ -44,12 +45,12 @@ InvalidationServiceFactory::InvalidationServiceFactory() InvalidationServiceFactory::~InvalidationServiceFactory() {} // static -ProfileKeyedService* +BrowserContextKeyedService* InvalidationServiceFactory::BuildP2PInvalidationServiceFor(Profile* profile) { return new P2PInvalidationService(profile); } -ProfileKeyedService* InvalidationServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* InvalidationServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); #if defined(OS_ANDROID) diff --git a/chrome/browser/invalidation/invalidation_service_factory.h b/chrome/browser/invalidation/invalidation_service_factory.h index 0b86143..da6900a 100644 --- a/chrome/browser/invalidation/invalidation_service_factory.h +++ b/chrome/browser/invalidation/invalidation_service_factory.h @@ -18,21 +18,23 @@ class Profile; namespace invalidation { -// A ProfileKeyedServiceFactory to construct InvalidationServices. The +// A BrowserContextKeyedServiceFactory to construct InvalidationServices. The // implementation of the InvalidationService may be completely different on // different platforms; this class should help to hide this complexity. It also // exposes some factory methods that are useful for setting up tests that rely // on invalidations. -class InvalidationServiceFactory : public ProfileKeyedServiceFactory { +class InvalidationServiceFactory : public BrowserContextKeyedServiceFactory { public: // TODO(rlarocque): Re-enable this once InvalidationFrontend can extend - // ProfileKeyedService. + // BrowserContextKeyedService. // static InvalidationFrontend* GetForProfile(Profile* profile); static InvalidationServiceFactory* GetInstance(); - static ProfileKeyedService* BuildP2PInvalidationServiceFor(Profile* profile); - static ProfileKeyedService* BuildTestServiceInstanceFor(Profile* profile); + static BrowserContextKeyedService* BuildP2PInvalidationServiceFor( + Profile* profile); + static BrowserContextKeyedService* BuildTestServiceInstanceFor( + Profile* profile); private: friend struct DefaultSingletonTraits<InvalidationServiceFactory>; @@ -40,8 +42,8 @@ class InvalidationServiceFactory : public ProfileKeyedServiceFactory { InvalidationServiceFactory(); virtual ~InvalidationServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; // TODO(rlarocque): Use this class, not InvalidatorStorage, to register // for user prefs. diff --git a/chrome/browser/invalidation/p2p_invalidation_service.h b/chrome/browser/invalidation/p2p_invalidation_service.h index 8ec1fa2..b624688 100644 --- a/chrome/browser/invalidation/p2p_invalidation_service.h +++ b/chrome/browser/invalidation/p2p_invalidation_service.h @@ -23,13 +23,13 @@ namespace invalidation { // only in tests, where we're unable to connect to a real invalidations server. class P2PInvalidationService : public base::NonThreadSafe, - public ProfileKeyedService, + public BrowserContextKeyedService, public InvalidationFrontend { public: explicit P2PInvalidationService(Profile* profile); virtual ~P2PInvalidationService(); - // Overrides ProfileKeyedService method. + // Overrides BrowserContextKeyedService method. virtual void Shutdown() OVERRIDE; // InvalidationFrontend implementation. diff --git a/chrome/browser/invalidation/ticl_invalidation_service.h b/chrome/browser/invalidation/ticl_invalidation_service.h index 137198a..dde6606 100644 --- a/chrome/browser/invalidation/ticl_invalidation_service.h +++ b/chrome/browser/invalidation/ticl_invalidation_service.h @@ -30,7 +30,7 @@ namespace invalidation { // It provides invalidations for desktop platforms (Win, Mac, Linux). class TiclInvalidationService : public base::NonThreadSafe, - public ProfileKeyedService, + public BrowserContextKeyedService, public InvalidationFrontend, public content::NotificationObserver, public syncer::InvalidationHandler { @@ -68,7 +68,7 @@ class TiclInvalidationService virtual void OnIncomingInvalidation( const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE; - // Overrides ProfileKeyedService method. + // Overrides BrowserContextKeyedService method. virtual void Shutdown() OVERRIDE; protected: diff --git a/chrome/browser/managed_mode/managed_user_registration_service.h b/chrome/browser/managed_mode/managed_user_registration_service.h index 81f041f..e28d84f 100644 --- a/chrome/browser/managed_mode/managed_user_registration_service.h +++ b/chrome/browser/managed_mode/managed_user_registration_service.h @@ -18,7 +18,7 @@ class GoogleServiceAuthError; // Holds the state necessary for registering a new managed user with the // management server and associating it with its custodian. It is owned by the // custodian's profile. -class ManagedUserRegistrationService : public ProfileKeyedService { +class ManagedUserRegistrationService : public BrowserContextKeyedService { public: // Callback for Register() below. If registration is successful, |token| will // contain an authentication token for the newly registered managed user, diff --git a/chrome/browser/managed_mode/managed_user_registration_service_factory.cc b/chrome/browser/managed_mode/managed_user_registration_service_factory.cc index 6142194..e5b302a 100644 --- a/chrome/browser/managed_mode/managed_user_registration_service_factory.cc +++ b/chrome/browser/managed_mode/managed_user_registration_service_factory.cc @@ -11,7 +11,7 @@ ManagedUserRegistrationService* ManagedUserRegistrationServiceFactory::GetForProfile(Profile* profile) { return static_cast<ManagedUserRegistrationService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -21,20 +21,21 @@ ManagedUserRegistrationServiceFactory::GetInstance() { } // static -ProfileKeyedService* ManagedUserRegistrationServiceFactory::BuildInstanceFor( - Profile* profile) { +BrowserContextKeyedService* +ManagedUserRegistrationServiceFactory::BuildInstanceFor(Profile* profile) { return new ManagedUserRegistrationService(); } ManagedUserRegistrationServiceFactory::ManagedUserRegistrationServiceFactory() - : ProfileKeyedServiceFactory("ManagedUserRegistrationService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ManagedUserRegistrationService", + BrowserContextDependencyManager::GetInstance()) { } ManagedUserRegistrationServiceFactory:: ~ManagedUserRegistrationServiceFactory() {} -ProfileKeyedService* +BrowserContextKeyedService* ManagedUserRegistrationServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return BuildInstanceFor(static_cast<Profile*>(profile)); diff --git a/chrome/browser/managed_mode/managed_user_registration_service_factory.h b/chrome/browser/managed_mode/managed_user_registration_service_factory.h index 6bbb07a..b579bf8 100644 --- a/chrome/browser/managed_mode/managed_user_registration_service_factory.h +++ b/chrome/browser/managed_mode/managed_user_registration_service_factory.h @@ -12,14 +12,14 @@ class ManagedUserRegistrationService; class Profile; class ManagedUserRegistrationServiceFactory - : public ProfileKeyedServiceFactory { + : public BrowserContextKeyedServiceFactory { public: static ManagedUserRegistrationService* GetForProfile(Profile* profile); static ManagedUserRegistrationServiceFactory* GetInstance(); // Used to create instances for testing. - static ProfileKeyedService* BuildInstanceFor(Profile* profile); + static BrowserContextKeyedService* BuildInstanceFor(Profile* profile); private: friend struct DefaultSingletonTraits<ManagedUserRegistrationServiceFactory>; @@ -27,8 +27,8 @@ class ManagedUserRegistrationServiceFactory ManagedUserRegistrationServiceFactory(); virtual ~ManagedUserRegistrationServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/managed_mode/managed_user_service.h b/chrome/browser/managed_mode/managed_user_service.h index c7c09df..4b9628c 100644 --- a/chrome/browser/managed_mode/managed_user_service.h +++ b/chrome/browser/managed_mode/managed_user_service.h @@ -33,7 +33,7 @@ class PrefRegistrySyncable; // This class handles all the information related to a given managed profile // (e.g. the installed content packs, the default URL filtering behavior, or // manual whitelist/blacklist overrides). -class ManagedUserService : public ProfileKeyedService, +class ManagedUserService : public BrowserContextKeyedService, public extensions::ManagementPolicy::Provider, public content::NotificationObserver { public: @@ -206,7 +206,7 @@ class ManagedUserService : public ProfileKeyedService, base::WeakPtrFactory<ManagedUserService> weak_ptr_factory_; - // Owns us via the ProfileKeyedService mechanism. + // Owns us via the BrowserContextKeyedService mechanism. Profile* profile_; content::NotificationRegistrar registrar_; diff --git a/chrome/browser/managed_mode/managed_user_service_factory.cc b/chrome/browser/managed_mode/managed_user_service_factory.cc index 2f401fa..0e613d5 100644 --- a/chrome/browser/managed_mode/managed_user_service_factory.cc +++ b/chrome/browser/managed_mode/managed_user_service_factory.cc @@ -13,7 +13,7 @@ // static ManagedUserService* ManagedUserServiceFactory::GetForProfile(Profile* profile) { return static_cast<ManagedUserService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -22,14 +22,15 @@ ManagedUserServiceFactory* ManagedUserServiceFactory::GetInstance() { } // static -ProfileKeyedService* ManagedUserServiceFactory::BuildInstanceFor( +BrowserContextKeyedService* ManagedUserServiceFactory::BuildInstanceFor( Profile* profile) { return new ManagedUserService(profile); } ManagedUserServiceFactory::ManagedUserServiceFactory() - : ProfileKeyedServiceFactory("ManagedUserService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ManagedUserService", + BrowserContextDependencyManager::GetInstance()) { DependsOn(extensions::ExtensionSystemFactory::GetInstance()); } @@ -40,7 +41,7 @@ content::BrowserContext* ManagedUserServiceFactory::GetBrowserContextToUse( return chrome::GetBrowserContextRedirectedInIncognito(context); } -ProfileKeyedService* ManagedUserServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* ManagedUserServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return BuildInstanceFor(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/managed_mode/managed_user_service_factory.h b/chrome/browser/managed_mode/managed_user_service_factory.h index f29d01d..b4fbe96 100644 --- a/chrome/browser/managed_mode/managed_user_service_factory.h +++ b/chrome/browser/managed_mode/managed_user_service_factory.h @@ -11,14 +11,14 @@ class ManagedUserService; class Profile; -class ManagedUserServiceFactory : public ProfileKeyedServiceFactory { +class ManagedUserServiceFactory : public BrowserContextKeyedServiceFactory { public: static ManagedUserService* GetForProfile(Profile* profile); static ManagedUserServiceFactory* GetInstance(); // Used to create instances for testing. - static ProfileKeyedService* BuildInstanceFor(Profile* profile); + static BrowserContextKeyedService* BuildInstanceFor(Profile* profile); private: friend struct DefaultSingletonTraits<ManagedUserServiceFactory>; @@ -26,10 +26,10 @@ class ManagedUserServiceFactory : public ProfileKeyedServiceFactory { ManagedUserServiceFactory(); virtual ~ManagedUserServiceFactory(); - // ProfileKeyedServiceFactory: + // BrowserContextKeyedServiceFactory: virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/media_galleries/media_galleries_preferences.h b/chrome/browser/media_galleries/media_galleries_preferences.h index 8f42320..d2faf8a 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences.h +++ b/chrome/browser/media_galleries/media_galleries_preferences.h @@ -111,7 +111,7 @@ typedef std::set<MediaGalleryPrefId> MediaGalleryPrefIdSet; // A class to manage the media gallery preferences. There is one instance per // user profile. -class MediaGalleriesPreferences : public ProfileKeyedService, +class MediaGalleriesPreferences : public BrowserContextKeyedService, public RemovableStorageObserver { public: class GalleryChangeObserver { @@ -190,7 +190,7 @@ class MediaGalleriesPreferences : public ProfileKeyedService, return known_galleries_; } - // ProfileKeyedService implementation: + // BrowserContextKeyedService implementation: virtual void Shutdown() OVERRIDE; static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); diff --git a/chrome/browser/media_galleries/media_galleries_preferences_factory.cc b/chrome/browser/media_galleries/media_galleries_preferences_factory.cc index 389cb8d..ab64aaa 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_factory.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences_factory.cc @@ -14,7 +14,7 @@ chrome::MediaGalleriesPreferences* MediaGalleriesPreferencesFactory::GetForProfile(Profile* profile) { return static_cast<chrome::MediaGalleriesPreferences*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -24,12 +24,14 @@ MediaGalleriesPreferencesFactory::GetInstance() { } MediaGalleriesPreferencesFactory::MediaGalleriesPreferencesFactory() - : ProfileKeyedServiceFactory("MediaGalleriesPreferences", - ProfileDependencyManager::GetInstance()) {} + : BrowserContextKeyedServiceFactory( + "MediaGalleriesPreferences", + BrowserContextDependencyManager::GetInstance()) {} MediaGalleriesPreferencesFactory::~MediaGalleriesPreferencesFactory() {} -ProfileKeyedService* MediaGalleriesPreferencesFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +MediaGalleriesPreferencesFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new chrome::MediaGalleriesPreferences(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/media_galleries/media_galleries_preferences_factory.h b/chrome/browser/media_galleries/media_galleries_preferences_factory.h index ff85d1f..2c98619 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_factory.h +++ b/chrome/browser/media_galleries/media_galleries_preferences_factory.h @@ -17,7 +17,8 @@ class MediaGalleriesPreferences; // Singleton that owns all MediaGalleriesPreferences and associates them with // Profiles. -class MediaGalleriesPreferencesFactory : public ProfileKeyedServiceFactory { +class MediaGalleriesPreferencesFactory + : public BrowserContextKeyedServiceFactory { public: // Use MediaFileSystemRegistry::GetPreferences() to get // MediaGalleriesPreferences. @@ -31,8 +32,8 @@ class MediaGalleriesPreferencesFactory : public ProfileKeyedServiceFactory { MediaGalleriesPreferencesFactory(); virtual ~MediaGalleriesPreferencesFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; diff --git a/chrome/browser/notifications/desktop_notification_service.h b/chrome/browser/notifications/desktop_notification_service.h index 787d035..866b63f 100644 --- a/chrome/browser/notifications/desktop_notification_service.h +++ b/chrome/browser/notifications/desktop_notification_service.h @@ -44,7 +44,7 @@ class PrefRegistrySyncable; // The DesktopNotificationService is an object, owned by the Profile, // which provides the creation of desktop "toasts" to web pages and workers. -class DesktopNotificationService : public ProfileKeyedService, +class DesktopNotificationService : public BrowserContextKeyedService, public content::NotificationObserver { public: enum DesktopNotificationSource { diff --git a/chrome/browser/notifications/desktop_notification_service_factory.cc b/chrome/browser/notifications/desktop_notification_service_factory.cc index acf6b51..f8b958a 100644 --- a/chrome/browser/notifications/desktop_notification_service_factory.cc +++ b/chrome/browser/notifications/desktop_notification_service_factory.cc @@ -18,7 +18,7 @@ DesktopNotificationService* DesktopNotificationServiceFactory::GetForProfile( Profile* profile) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); return static_cast<DesktopNotificationService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -28,14 +28,16 @@ DesktopNotificationServiceFactory* DesktopNotificationServiceFactory:: } DesktopNotificationServiceFactory::DesktopNotificationServiceFactory() - : ProfileKeyedServiceFactory("DesktopNotificationService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "DesktopNotificationService", + BrowserContextDependencyManager::GetInstance()) { } DesktopNotificationServiceFactory::~DesktopNotificationServiceFactory() { } -ProfileKeyedService* DesktopNotificationServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +DesktopNotificationServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { DesktopNotificationService* service = new DesktopNotificationService(static_cast<Profile*>(profile), NULL); diff --git a/chrome/browser/notifications/desktop_notification_service_factory.h b/chrome/browser/notifications/desktop_notification_service_factory.h index 10a6c09..c616b50 100644 --- a/chrome/browser/notifications/desktop_notification_service_factory.h +++ b/chrome/browser/notifications/desktop_notification_service_factory.h @@ -15,7 +15,8 @@ class Profile; // Singleton that owns all DesktopNotificationServices and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated DesktopNotificationService. -class DesktopNotificationServiceFactory : public ProfileKeyedServiceFactory { +class DesktopNotificationServiceFactory + : public BrowserContextKeyedServiceFactory { public: // Returns the DesktopNotificationService that provides desktop notifications // for |profile|. @@ -29,8 +30,8 @@ class DesktopNotificationServiceFactory : public ProfileKeyedServiceFactory { DesktopNotificationServiceFactory(); virtual ~DesktopNotificationServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc index 5ce35d9..8432999 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc @@ -26,7 +26,7 @@ ChromeNotifierService::ChromeNotifierService(Profile* profile, : profile_(profile), notification_manager_(manager) {} ChromeNotifierService::~ChromeNotifierService() {} -// Methods from ProfileKeyedService. +// Methods from BrowserContextKeyedService. void ChromeNotifierService::Shutdown() { } diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h index f99cd7a..ddbfc3d 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h @@ -23,12 +23,12 @@ namespace notifier { // delivered notifications for chrome. These are obtained from the sync service // and kept up to date. class ChromeNotifierService : public syncer::SyncableService, - public ProfileKeyedService { + public BrowserContextKeyedService { public: ChromeNotifierService(Profile* profile, NotificationUIManager* manager); virtual ~ChromeNotifierService(); - // Methods from ProfileKeyedService. + // Methods from BrowserContextKeyedService. virtual void Shutdown() OVERRIDE; // syncer::SyncableService implementation. diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc index 812a71b..a029c4d 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc @@ -14,7 +14,7 @@ namespace notifier { ChromeNotifierService* ChromeNotifierServiceFactory::GetForProfile( Profile* profile, Profile::ServiceAccessType sat) { return static_cast<ChromeNotifierService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -23,13 +23,14 @@ ChromeNotifierServiceFactory* ChromeNotifierServiceFactory::GetInstance() { } ChromeNotifierServiceFactory::ChromeNotifierServiceFactory() - : ProfileKeyedServiceFactory( - "ChromeNotifierService", ProfileDependencyManager::GetInstance()) {} + : BrowserContextKeyedServiceFactory( + "ChromeNotifierService", + BrowserContextDependencyManager::GetInstance()) {} ChromeNotifierServiceFactory::~ChromeNotifierServiceFactory() { } -ProfileKeyedService* +BrowserContextKeyedService* ChromeNotifierServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { NotificationUIManager* notification_manager = diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h index 2fe308f..2261f9c 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h @@ -13,7 +13,7 @@ namespace notifier { class ChromeNotifierService; -class ChromeNotifierServiceFactory : public ProfileKeyedServiceFactory { +class ChromeNotifierServiceFactory : public BrowserContextKeyedServiceFactory { public: static ChromeNotifierService* GetForProfile( Profile* profile, Profile::ServiceAccessType sat); @@ -26,8 +26,8 @@ class ChromeNotifierServiceFactory : public ProfileKeyedServiceFactory { ChromeNotifierServiceFactory(); virtual ~ChromeNotifierServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/password_manager/mock_password_store.cc b/chrome/browser/password_manager/mock_password_store.cc index e47f4b0..6b8db11 100644 --- a/chrome/browser/password_manager/mock_password_store.cc +++ b/chrome/browser/password_manager/mock_password_store.cc @@ -7,7 +7,7 @@ MockPasswordStore::MockPasswordStore() {} // static -scoped_refptr<RefcountedProfileKeyedService> MockPasswordStore::Build( +scoped_refptr<RefcountedBrowserContextKeyedService> MockPasswordStore::Build( content::BrowserContext* profile) { return new MockPasswordStore; } diff --git a/chrome/browser/password_manager/mock_password_store.h b/chrome/browser/password_manager/mock_password_store.h index ae58a0b..38c2274 100644 --- a/chrome/browser/password_manager/mock_password_store.h +++ b/chrome/browser/password_manager/mock_password_store.h @@ -17,7 +17,7 @@ class MockPasswordStore : public PasswordStore { public: MockPasswordStore(); - static scoped_refptr<RefcountedProfileKeyedService> Build( + static scoped_refptr<RefcountedBrowserContextKeyedService> Build( content::BrowserContext* profile); MOCK_METHOD1(RemoveLogin, void(const content::PasswordForm&)); diff --git a/chrome/browser/password_manager/password_store.h b/chrome/browser/password_manager/password_store.h index 26e36d9..04fdffc 100644 --- a/chrome/browser/password_manager/password_store.h +++ b/chrome/browser/password_manager/password_store.h @@ -40,7 +40,7 @@ void UpdateLogin(PasswordStore* store, const content::PasswordForm& form); // The login request/manipulation API is not threadsafe and must be used // from the UI thread. class PasswordStore - : public RefcountedProfileKeyedService, + : public RefcountedBrowserContextKeyedService, public CancelableRequestProvider { public: typedef base::Callback< diff --git a/chrome/browser/password_manager/password_store_default.h b/chrome/browser/password_manager/password_store_default.h index 6f23776..2fb418c 100644 --- a/chrome/browser/password_manager/password_store_default.h +++ b/chrome/browser/password_manager/password_store_default.h @@ -24,7 +24,7 @@ class PasswordStoreDefault : public PasswordStore { protected: virtual ~PasswordStoreDefault(); - // Implements RefCountedProfileKeyedService. + // Implements RefCountedBrowserContextKeyedService. virtual void ShutdownOnUIThread() OVERRIDE; // Implements PasswordStore interface. diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc index d66a6bc..1c9a438 100644 --- a/chrome/browser/password_manager/password_store_factory.cc +++ b/chrome/browser/password_manager/password_store_factory.cc @@ -54,7 +54,7 @@ scoped_refptr<PasswordStore> PasswordStoreFactory::GetForProfile( } return static_cast<PasswordStore*>( - GetInstance()->GetServiceForProfile(profile, true).get()); + GetInstance()->GetServiceForBrowserContext(profile, true).get()); } // static @@ -63,9 +63,9 @@ PasswordStoreFactory* PasswordStoreFactory::GetInstance() { } PasswordStoreFactory::PasswordStoreFactory() - : RefcountedProfileKeyedServiceFactory( + : RefcountedBrowserContextKeyedServiceFactory( "PasswordStore", - ProfileDependencyManager::GetInstance()) { + BrowserContextDependencyManager::GetInstance()) { DependsOn(WebDataServiceFactory::GetInstance()); } @@ -93,7 +93,7 @@ LocalProfileId PasswordStoreFactory::GetLocalProfileId( } #endif -scoped_refptr<RefcountedProfileKeyedService> +scoped_refptr<RefcountedBrowserContextKeyedService> PasswordStoreFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); diff --git a/chrome/browser/password_manager/password_store_factory.h b/chrome/browser/password_manager/password_store_factory.h index 631fc7a..2207df1 100644 --- a/chrome/browser/password_manager/password_store_factory.h +++ b/chrome/browser/password_manager/password_store_factory.h @@ -24,7 +24,8 @@ typedef int LocalProfileId; // Singleton that owns all PasswordStores and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated PasswordStore. -class PasswordStoreFactory : public RefcountedProfileKeyedServiceFactory { +class PasswordStoreFactory + : public RefcountedBrowserContextKeyedServiceFactory { public: static scoped_refptr<PasswordStore> GetForProfile( Profile* profile, Profile::ServiceAccessType set); @@ -41,9 +42,9 @@ class PasswordStoreFactory : public RefcountedProfileKeyedServiceFactory { LocalProfileId GetLocalProfileId(PrefService* prefs) const; #endif - // ProfileKeyedServiceFactory: - virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - content::BrowserContext* context) const OVERRIDE; + // BrowserContextKeyedServiceFactory: + virtual scoped_refptr<RefcountedBrowserContextKeyedService> + BuildServiceInstanceFor(content::BrowserContext* context) const OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( diff --git a/chrome/browser/password_manager/password_store_win.h b/chrome/browser/password_manager/password_store_win.h index 8493265..c831afd 100644 --- a/chrome/browser/password_manager/password_store_win.h +++ b/chrome/browser/password_manager/password_store_win.h @@ -25,7 +25,7 @@ class PasswordStoreWin : public PasswordStoreDefault { Profile* profile, WebDataService* web_data_service); - // RefcountedProfileKeyedService: + // RefcountedBrowserContextKeyedService: virtual void ShutdownOnUIThread() OVERRIDE; private: diff --git a/chrome/browser/password_manager/test_password_store.cc b/chrome/browser/password_manager/test_password_store.cc index e056d1c..4923634 100644 --- a/chrome/browser/password_manager/test_password_store.cc +++ b/chrome/browser/password_manager/test_password_store.cc @@ -7,7 +7,7 @@ #include "content/public/common/password_form.h" // static -scoped_refptr<RefcountedProfileKeyedService> TestPasswordStore::Create( +scoped_refptr<RefcountedBrowserContextKeyedService> TestPasswordStore::Create( content::BrowserContext* profile) { return make_scoped_refptr(new TestPasswordStore); } diff --git a/chrome/browser/password_manager/test_password_store.h b/chrome/browser/password_manager/test_password_store.h index 1ee2f70..a7d2f17 100644 --- a/chrome/browser/password_manager/test_password_store.h +++ b/chrome/browser/password_manager/test_password_store.h @@ -16,7 +16,7 @@ namespace content { class BrowserContext; } -scoped_refptr<RefcountedProfileKeyedService> CreateTestPasswordStore( +scoped_refptr<RefcountedBrowserContextKeyedService> CreateTestPasswordStore( content::BrowserContext* profile); // A very simple PasswordStore implementation that keeps all of the passwords @@ -28,8 +28,8 @@ class TestPasswordStore : public PasswordStore { TestPasswordStore(); // Helper function for registration with - // RefcountedProfileKeyedService::SetTestingFactory - static scoped_refptr<RefcountedProfileKeyedService> Create( + // RefcountedBrowserContextKeyedService::SetTestingFactory + static scoped_refptr<RefcountedBrowserContextKeyedService> Create( content::BrowserContext* profile); typedef std::map<std::string /* signon_realm */, diff --git a/chrome/browser/plugins/plugin_prefs.h b/chrome/browser/plugins/plugin_prefs.h index c4d0f04..93872f7 100644 --- a/chrome/browser/plugins/plugin_prefs.h +++ b/chrome/browser/plugins/plugin_prefs.h @@ -33,7 +33,7 @@ class PluginList; // This class stores information about whether a plug-in or a plug-in group is // enabled or disabled. // Except where otherwise noted, it can be used on every thread. -class PluginPrefs : public RefcountedProfileKeyedService { +class PluginPrefs : public RefcountedBrowserContextKeyedService { public: enum PolicyStatus { NO_POLICY = 0, // Neither enabled or disabled by policy. diff --git a/chrome/browser/plugins/plugin_prefs_factory.cc b/chrome/browser/plugins/plugin_prefs_factory.cc index ab60dc1..a5cb5cc 100644 --- a/chrome/browser/plugins/plugin_prefs_factory.cc +++ b/chrome/browser/plugins/plugin_prefs_factory.cc @@ -24,24 +24,24 @@ PluginPrefsFactory* PluginPrefsFactory::GetInstance() { scoped_refptr<PluginPrefs> PluginPrefsFactory::GetPrefsForProfile( Profile* profile) { return static_cast<PluginPrefs*>( - GetInstance()->GetServiceForProfile(profile, true).get()); + GetInstance()->GetServiceForBrowserContext(profile, true).get()); } // static -scoped_refptr<RefcountedProfileKeyedService> +scoped_refptr<RefcountedBrowserContextKeyedService> PluginPrefsFactory::CreateForTestingProfile(content::BrowserContext* profile) { return static_cast<PluginPrefs*>( GetInstance()->BuildServiceInstanceFor(profile).get()); } PluginPrefsFactory::PluginPrefsFactory() - : RefcountedProfileKeyedServiceFactory( - "PluginPrefs", ProfileDependencyManager::GetInstance()) { + : RefcountedBrowserContextKeyedServiceFactory( + "PluginPrefs", BrowserContextDependencyManager::GetInstance()) { } PluginPrefsFactory::~PluginPrefsFactory() {} -scoped_refptr<RefcountedProfileKeyedService> +scoped_refptr<RefcountedBrowserContextKeyedService> PluginPrefsFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); @@ -94,6 +94,6 @@ bool PluginPrefsFactory::ServiceIsNULLWhileTesting() const { return true; } -bool PluginPrefsFactory::ServiceIsCreatedWithProfile() const { +bool PluginPrefsFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/plugins/plugin_prefs_factory.h b/chrome/browser/plugins/plugin_prefs_factory.h index 9087935..4e2137b 100644 --- a/chrome/browser/plugins/plugin_prefs_factory.h +++ b/chrome/browser/plugins/plugin_prefs_factory.h @@ -11,9 +11,9 @@ class PluginPrefs; class Profile; -class ProfileKeyedService; +class BrowserContextKeyedService; -class PluginPrefsFactory : public RefcountedProfileKeyedServiceFactory { +class PluginPrefsFactory : public RefcountedBrowserContextKeyedServiceFactory { public: static scoped_refptr<PluginPrefs> GetPrefsForProfile(Profile* profile); @@ -24,23 +24,23 @@ class PluginPrefsFactory : public RefcountedProfileKeyedServiceFactory { friend struct DefaultSingletonTraits<PluginPrefsFactory>; // Helper method for PluginPrefs::GetForTestingProfile. - static scoped_refptr<RefcountedProfileKeyedService> CreateForTestingProfile( - content::BrowserContext* profile); + static scoped_refptr<RefcountedBrowserContextKeyedService> + CreateForTestingProfile(content::BrowserContext* profile); PluginPrefsFactory(); virtual ~PluginPrefsFactory(); - // RefcountedProfileKeyedServiceFactory methods: - virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - content::BrowserContext* context) const OVERRIDE; + // RefcountedBrowserContextKeyedServiceFactory methods: + virtual scoped_refptr<RefcountedBrowserContextKeyedService> + BuildServiceInstanceFor(content::BrowserContext* context) const OVERRIDE; - // ProfileKeyedServiceFactory methods: + // BrowserContextKeyedServiceFactory methods: virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; }; #endif // CHROME_BROWSER_PLUGINS_PLUGIN_PREFS_FACTORY_H_ diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager.h b/chrome/browser/policy/cloud/user_cloud_policy_manager.h index 48db8ef..ddfdae3 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager.h +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager.h @@ -24,7 +24,7 @@ class UserCloudPolicyStore; // UserCloudPolicyManager handles initialization of user policy for Chrome // Profiles on the desktop platforms. class UserCloudPolicyManager : public CloudPolicyManager, - public ProfileKeyedService { + public BrowserContextKeyedService { public: UserCloudPolicyManager(Profile* profile, scoped_ptr<UserCloudPolicyStore> store); diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc index e8c850a..9f9fea7 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc @@ -33,8 +33,9 @@ scoped_ptr<UserCloudPolicyManager> } UserCloudPolicyManagerFactory::UserCloudPolicyManagerFactory() - : ProfileKeyedBaseFactory("UserCloudPolicyManager", - ProfileDependencyManager::GetInstance()) {} + : BrowserContextKeyedBaseFactory( + "UserCloudPolicyManager", + BrowserContextDependencyManager::GetInstance()) {} UserCloudPolicyManagerFactory::~UserCloudPolicyManagerFactory() {} @@ -63,7 +64,7 @@ scoped_ptr<UserCloudPolicyManager> return manager.Pass(); } -void UserCloudPolicyManagerFactory::ProfileShutdown( +void UserCloudPolicyManagerFactory::BrowserContextShutdown( content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); if (profile->IsOffTheRecord()) @@ -71,7 +72,7 @@ void UserCloudPolicyManagerFactory::ProfileShutdown( UserCloudPolicyManager* manager = GetManagerForProfile(profile); if (manager) { manager->CloudPolicyManager::Shutdown(); - manager->ProfileKeyedService::Shutdown(); + manager->BrowserContextKeyedService::Shutdown(); } } diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h index 0f7c0a8..b1690a9 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h @@ -17,21 +17,21 @@ namespace policy { class UserCloudPolicyManager; -// ProfileKeyedBaseFactory implementation for UserCloudPolicyManager +// BrowserContextKeyedBaseFactory implementation for UserCloudPolicyManager // instances that initialize per-profile cloud policy settings on the desktop // platforms. // -// UserCloudPolicyManager is handled different than other ProfileKeyedServices -// because it is a dependency of PrefService. Therefore, lifetime of instances -// is managed by Profile, Profile startup code invokes CreateForProfile() -// explicitly, takes ownership, and the instance is only deleted after -// PrefService destruction. +// UserCloudPolicyManager is handled different than other +// BrowserContextKeyedServices because it is a dependency of PrefService. +// Therefore, lifetime of instances is managed by Profile, Profile startup code +// invokes CreateForProfile() explicitly, takes ownership, and the instance +// is only deleted after PrefService destruction. // // TODO(mnissler): Remove the special lifetime management in favor of // PrefService directly depending on UserCloudPolicyManager once the former has -// been converted to a ProfileKeyedService. See also http://crbug.com/131843 and -// http://crbug.com/131844. -class UserCloudPolicyManagerFactory : public ProfileKeyedBaseFactory { +// been converted to a BrowserContextKeyedService. +// See also http://crbug.com/131843 and http://crbug.com/131844. +class UserCloudPolicyManagerFactory : public BrowserContextKeyedBaseFactory { public: // Returns an instance of the UserCloudPolicyManagerFactory singleton. static UserCloudPolicyManagerFactory* GetInstance(); @@ -62,8 +62,9 @@ class UserCloudPolicyManagerFactory : public ProfileKeyedBaseFactory { Profile* profile, bool force_immediate_load); - // ProfileKeyedBaseFactory: - virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE; + // BrowserContextKeyedBaseFactory: + virtual void BrowserContextShutdown( + content::BrowserContext* profile) OVERRIDE; virtual void SetEmptyTestingFactory( content::BrowserContext* profile) OVERRIDE; virtual void CreateServiceNow(content::BrowserContext* profile) OVERRIDE; diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc b/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc index 0e7eb64..026c149 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc @@ -39,7 +39,7 @@ class UserCloudPolicyManagerTest : public testing::Test { if (manager_) { manager_->RemoveObserver(&observer_); manager_->CloudPolicyManager::Shutdown(); - manager_->ProfileKeyedService::Shutdown(); + manager_->BrowserContextKeyedService::Shutdown(); } } diff --git a/chrome/browser/policy/cloud/user_policy_signin_service.h b/chrome/browser/policy/cloud/user_policy_signin_service.h index 5c640bb..fda278f 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service.h +++ b/chrome/browser/policy/cloud/user_policy_signin_service.h @@ -40,7 +40,7 @@ class UserCloudPolicyManager; // Finally, if the user signs out, this class is responsible for shutting down // the policy infrastructure to ensure that any cached policy is cleared. class UserPolicySigninService - : public ProfileKeyedService, + : public BrowserContextKeyedService, public CloudPolicyClient::Observer, public CloudPolicyService::Observer, public content::NotificationObserver { @@ -86,7 +86,7 @@ class UserPolicySigninService virtual void OnRegistrationStateChanged(CloudPolicyClient* client) OVERRIDE; virtual void OnClientError(CloudPolicyClient* client) OVERRIDE; - // ProfileKeyedService implementation: + // BrowserContextKeyedService implementation: virtual void Shutdown() OVERRIDE; private: diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc b/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc index 5d90542..3125feb 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc +++ b/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc @@ -17,8 +17,9 @@ namespace policy { UserPolicySigninServiceFactory::UserPolicySigninServiceFactory() - : ProfileKeyedServiceFactory("UserPolicySigninService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "UserPolicySigninService", + BrowserContextDependencyManager::GetInstance()) { DependsOn(TokenServiceFactory::GetInstance()); DependsOn(SigninManagerFactory::GetInstance()); DependsOn(UserCloudPolicyManagerFactory::GetInstance()); @@ -30,7 +31,7 @@ UserPolicySigninServiceFactory::~UserPolicySigninServiceFactory() {} UserPolicySigninService* UserPolicySigninServiceFactory::GetForProfile( Profile* profile) { return static_cast<UserPolicySigninService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -38,12 +39,14 @@ UserPolicySigninServiceFactory* UserPolicySigninServiceFactory::GetInstance() { return Singleton<UserPolicySigninServiceFactory>::get(); } -ProfileKeyedService* UserPolicySigninServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +UserPolicySigninServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new UserPolicySigninService(static_cast<Profile*>(profile)); } -bool UserPolicySigninServiceFactory::ServiceIsCreatedWithProfile() const { +bool +UserPolicySigninServiceFactory::ServiceIsCreatedWithBrowserContext() const { // Create this object when the profile is created so it can track any // user signin activity. return true; diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_factory.h b/chrome/browser/policy/cloud/user_policy_signin_service_factory.h index 0a75dd5..9f925ec 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service_factory.h +++ b/chrome/browser/policy/cloud/user_policy_signin_service_factory.h @@ -20,7 +20,8 @@ class UserPolicySigninService; // Singleton that owns all UserPolicySigninServices and creates/deletes them as // new Profiles are created/shutdown. -class UserPolicySigninServiceFactory : public ProfileKeyedServiceFactory { +class UserPolicySigninServiceFactory + : public BrowserContextKeyedServiceFactory { public: // Returns an instance of the UserPolicySigninServiceFactory singleton. static UserPolicySigninServiceFactory* GetInstance(); @@ -30,12 +31,12 @@ class UserPolicySigninServiceFactory : public ProfileKeyedServiceFactory { static UserPolicySigninService* GetForProfile(Profile* profile); protected: - // ProfileKeyedServiceFactory implementation. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory implementation. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; // Overridden to cause this object to be created when the profile is created. - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; // Register the preferences related to cloud-based user policy. virtual void RegisterUserPrefs( diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc index 5f9e7e7..cb2e8c9 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc +++ b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc @@ -74,7 +74,7 @@ class SigninManagerFake : public FakeSigninManager { SignOut(); } - static ProfileKeyedService* Build(content::BrowserContext* profile) { + static BrowserContextKeyedService* Build(content::BrowserContext* profile) { return new SigninManagerFake(static_cast<Profile*>(profile)); } }; diff --git a/chrome/browser/policy/profile_policy_connector.h b/chrome/browser/policy/profile_policy_connector.h index 5d84153..0669c7d 100644 --- a/chrome/browser/policy/profile_policy_connector.h +++ b/chrome/browser/policy/profile_policy_connector.h @@ -28,9 +28,9 @@ class DeviceLocalAccountPolicyProvider; class ManagedModePolicyProvider; class PolicyService; -// A ProfileKeyedService that creates and manages the per-Profile policy +// A BrowserContextKeyedService that creates and manages the per-Profile policy // components. -class ProfilePolicyConnector : public ProfileKeyedService { +class ProfilePolicyConnector : public BrowserContextKeyedService { public: explicit ProfilePolicyConnector(Profile* profile); virtual ~ProfilePolicyConnector(); @@ -41,7 +41,7 @@ class ProfilePolicyConnector : public ProfileKeyedService { void InitForTesting(scoped_ptr<PolicyService> service); - // ProfileKeyedService: + // BrowserContextKeyedService: virtual void Shutdown() OVERRIDE; // This is never NULL. diff --git a/chrome/browser/policy/profile_policy_connector_factory.cc b/chrome/browser/policy/profile_policy_connector_factory.cc index ad609b5..26a87a2 100644 --- a/chrome/browser/policy/profile_policy_connector_factory.cc +++ b/chrome/browser/policy/profile_policy_connector_factory.cc @@ -52,8 +52,9 @@ void ProfilePolicyConnectorFactory::SetServiceForTesting( } ProfilePolicyConnectorFactory::ProfilePolicyConnectorFactory() - : ProfileKeyedBaseFactory("ProfilePolicyConnector", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedBaseFactory( + "ProfilePolicyConnector", + BrowserContextDependencyManager::GetInstance()) { #if defined(ENABLE_CONFIGURATION_POLICY) #if defined(OS_CHROMEOS) DependsOn(UserCloudPolicyManagerFactoryChromeOS::GetInstance()); @@ -89,7 +90,7 @@ scoped_ptr<ProfilePolicyConnector> return scoped_ptr<ProfilePolicyConnector>(connector); } -void ProfilePolicyConnectorFactory::ProfileShutdown( +void ProfilePolicyConnectorFactory::BrowserContextShutdown( content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); if (profile->IsOffTheRecord()) @@ -99,12 +100,12 @@ void ProfilePolicyConnectorFactory::ProfileShutdown( it->second->Shutdown(); } -void ProfilePolicyConnectorFactory::ProfileDestroyed( +void ProfilePolicyConnectorFactory::BrowserContextDestroyed( content::BrowserContext* context) { ConnectorMap::iterator it = connectors_.find(static_cast<Profile*>(context)); if (it != connectors_.end()) connectors_.erase(it); - ProfileKeyedBaseFactory::ProfileDestroyed(context); + BrowserContextKeyedBaseFactory::BrowserContextDestroyed(context); } void ProfilePolicyConnectorFactory::RegisterUserPrefs( diff --git a/chrome/browser/policy/profile_policy_connector_factory.h b/chrome/browser/policy/profile_policy_connector_factory.h index 399b8f2..04ca3e4 100644 --- a/chrome/browser/policy/profile_policy_connector_factory.h +++ b/chrome/browser/policy/profile_policy_connector_factory.h @@ -30,7 +30,7 @@ class ProfilePolicyConnector; // policy providers and other policy components. // TODO(joaodasilva): convert this class to a proper PKS once the PrefService, // which depends on this class, becomes a PKS too. -class ProfilePolicyConnectorFactory : public ProfileKeyedBaseFactory { +class ProfilePolicyConnectorFactory : public BrowserContextKeyedBaseFactory { public: // Returns the ProfilePolicyConnectorFactory singleton. static ProfilePolicyConnectorFactory* GetInstance(); @@ -51,7 +51,7 @@ class ProfilePolicyConnectorFactory : public ProfileKeyedBaseFactory { // Overrides the |connector| for the given |profile|; use only in tests. // Once this class becomes a proper PKS then it can reuse the testing - // methods of ProfileKeyedServiceFactory. + // methods of BrowserContextKeyedServiceFactory. void SetServiceForTesting(Profile* profile, ProfilePolicyConnector* connector); @@ -68,9 +68,11 @@ class ProfilePolicyConnectorFactory : public ProfileKeyedBaseFactory { bool force_immediate_load, base::SequencedTaskRunner* sequenced_task_runner); - // ProfileKeyedBaseFactory: - virtual void ProfileShutdown(content::BrowserContext* context) OVERRIDE; - virtual void ProfileDestroyed(content::BrowserContext* context) OVERRIDE; + // BrowserContextKeyedBaseFactory: + virtual void BrowserContextShutdown( + content::BrowserContext* context) OVERRIDE; + virtual void BrowserContextDestroyed( + content::BrowserContext* context) OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; virtual void SetEmptyTestingFactory( diff --git a/chrome/browser/predictors/autocomplete_action_predictor.h b/chrome/browser/predictors/autocomplete_action_predictor.h index e115e71..ae19aaa 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor.h +++ b/chrome/browser/predictors/autocomplete_action_predictor.h @@ -59,7 +59,7 @@ namespace predictors { // PostTaskAndReply without fear of crashes if it is destroyed before the reply // triggers. This is necessary during initialization. class AutocompleteActionPredictor - : public ProfileKeyedService, + : public BrowserContextKeyedService, public content::NotificationObserver, public base::SupportsWeakPtr<AutocompleteActionPredictor> { public: diff --git a/chrome/browser/predictors/autocomplete_action_predictor_factory.cc b/chrome/browser/predictors/autocomplete_action_predictor_factory.cc index ee29b53..c08e6f7 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_factory.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor_factory.cc @@ -17,7 +17,7 @@ namespace predictors { AutocompleteActionPredictor* AutocompleteActionPredictorFactory::GetForProfile( Profile* profile) { return static_cast<AutocompleteActionPredictor*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -27,8 +27,9 @@ AutocompleteActionPredictorFactory* } AutocompleteActionPredictorFactory::AutocompleteActionPredictorFactory() - : ProfileKeyedServiceFactory("AutocompleteActionPredictor", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "AutocompleteActionPredictor", + BrowserContextDependencyManager::GetInstance()) { DependsOn(HistoryServiceFactory::GetInstance()); DependsOn(PredictorDatabaseFactory::GetInstance()); } @@ -41,7 +42,7 @@ AutocompleteActionPredictorFactory::GetBrowserContextToUse( return chrome::GetBrowserContextOwnInstanceInIncognito(context); } -ProfileKeyedService* +BrowserContextKeyedService* AutocompleteActionPredictorFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new AutocompleteActionPredictor(static_cast<Profile*>(profile)); diff --git a/chrome/browser/predictors/autocomplete_action_predictor_factory.h b/chrome/browser/predictors/autocomplete_action_predictor_factory.h index 45493bf..72da7f6 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_factory.h +++ b/chrome/browser/predictors/autocomplete_action_predictor_factory.h @@ -18,7 +18,8 @@ class AutocompleteActionPredictor; // Singleton that owns all AutocompleteActionPredictors and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated AutocompleteActionPredictor. -class AutocompleteActionPredictorFactory : public ProfileKeyedServiceFactory { +class AutocompleteActionPredictorFactory + : public BrowserContextKeyedServiceFactory { public: static AutocompleteActionPredictor* GetForProfile(Profile* profile); @@ -30,10 +31,10 @@ class AutocompleteActionPredictorFactory : public ProfileKeyedServiceFactory { AutocompleteActionPredictorFactory(); virtual ~AutocompleteActionPredictorFactory(); - // ProfileKeyedServiceFactory: + // BrowserContextKeyedServiceFactory: virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(AutocompleteActionPredictorFactory); diff --git a/chrome/browser/predictors/predictor_database.h b/chrome/browser/predictors/predictor_database.h index 362c23c..01ef22e 100644 --- a/chrome/browser/predictors/predictor_database.h +++ b/chrome/browser/predictors/predictor_database.h @@ -21,7 +21,7 @@ class LoggedInPredictorTable; class PredictorDatabaseInternal; class ResourcePrefetchPredictorTables; -class PredictorDatabase : public ProfileKeyedService { +class PredictorDatabase : public BrowserContextKeyedService { public: explicit PredictorDatabase(Profile* profile); virtual ~PredictorDatabase(); @@ -34,7 +34,7 @@ class PredictorDatabase : public ProfileKeyedService { sql::Connection* GetDatabase(); private: - // ProfileKeyedService + // BrowserContextKeyedService virtual void Shutdown() OVERRIDE; scoped_refptr<PredictorDatabaseInternal> db_; diff --git a/chrome/browser/predictors/predictor_database_factory.cc b/chrome/browser/predictors/predictor_database_factory.cc index b3bec2ab..38d6ae8 100644 --- a/chrome/browser/predictors/predictor_database_factory.cc +++ b/chrome/browser/predictors/predictor_database_factory.cc @@ -14,7 +14,7 @@ namespace predictors { // static PredictorDatabase* PredictorDatabaseFactory::GetForProfile(Profile* profile) { return static_cast<PredictorDatabase*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -23,14 +23,14 @@ PredictorDatabaseFactory* PredictorDatabaseFactory::GetInstance() { } PredictorDatabaseFactory::PredictorDatabaseFactory() - : ProfileKeyedServiceFactory( - "PredictorDatabase", ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "PredictorDatabase", BrowserContextDependencyManager::GetInstance()) { } PredictorDatabaseFactory::~PredictorDatabaseFactory() { } -ProfileKeyedService* PredictorDatabaseFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* PredictorDatabaseFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new PredictorDatabase(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/predictors/predictor_database_factory.h b/chrome/browser/predictors/predictor_database_factory.h index b5a71be..8e1e241 100644 --- a/chrome/browser/predictors/predictor_database_factory.h +++ b/chrome/browser/predictors/predictor_database_factory.h @@ -17,7 +17,7 @@ class PredictorDatabase; // Singleton that owns the PredictorDatabases and associates them with // Profiles. -class PredictorDatabaseFactory : public ProfileKeyedServiceFactory { +class PredictorDatabaseFactory : public BrowserContextKeyedServiceFactory { public: static PredictorDatabase* GetForProfile(Profile* profile); @@ -29,8 +29,8 @@ class PredictorDatabaseFactory : public ProfileKeyedServiceFactory { PredictorDatabaseFactory(); virtual ~PredictorDatabaseFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(PredictorDatabaseFactory); diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h index 24261ae..fcf54b7 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor.h +++ b/chrome/browser/predictors/resource_prefetch_predictor.h @@ -70,7 +70,7 @@ class ResourcePrefetcherManager; // TODO(shishir): Do speculative prefetching for https resources and/or https // main frame urls. class ResourcePrefetchPredictor - : public ProfileKeyedService, + : public BrowserContextKeyedService, public content::NotificationObserver, public base::SupportsWeakPtr<ResourcePrefetchPredictor> { public: @@ -182,7 +182,7 @@ class ResourcePrefetchPredictor const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; - // ProfileKeyedService methods OVERRIDE. + // BrowserContextKeyedService methods OVERRIDE. virtual void Shutdown() OVERRIDE; // Functions called on different network events pertaining to the loading of diff --git a/chrome/browser/predictors/resource_prefetch_predictor_factory.cc b/chrome/browser/predictors/resource_prefetch_predictor_factory.cc index ef15daf..d8e78c7 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_factory.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor_factory.cc @@ -17,7 +17,7 @@ namespace predictors { ResourcePrefetchPredictor* ResourcePrefetchPredictorFactory::GetForProfile( Profile* profile) { return static_cast<ResourcePrefetchPredictor*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -27,15 +27,16 @@ ResourcePrefetchPredictorFactory::GetInstance() { } ResourcePrefetchPredictorFactory::ResourcePrefetchPredictorFactory() - : ProfileKeyedServiceFactory("ResourcePrefetchPredictor", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ResourcePrefetchPredictor", + BrowserContextDependencyManager::GetInstance()) { DependsOn(HistoryServiceFactory::GetInstance()); DependsOn(PredictorDatabaseFactory::GetInstance()); } ResourcePrefetchPredictorFactory::~ResourcePrefetchPredictorFactory() {} -ProfileKeyedService* +BrowserContextKeyedService* ResourcePrefetchPredictorFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); diff --git a/chrome/browser/predictors/resource_prefetch_predictor_factory.h b/chrome/browser/predictors/resource_prefetch_predictor_factory.h index 24e0379..802b544 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_factory.h +++ b/chrome/browser/predictors/resource_prefetch_predictor_factory.h @@ -15,7 +15,8 @@ namespace predictors { class ResourcePrefetchPredictor; -class ResourcePrefetchPredictorFactory : public ProfileKeyedServiceFactory { +class ResourcePrefetchPredictorFactory + : public BrowserContextKeyedServiceFactory { public: static ResourcePrefetchPredictor* GetForProfile(Profile* profile); static ResourcePrefetchPredictorFactory* GetInstance(); @@ -26,8 +27,8 @@ class ResourcePrefetchPredictorFactory : public ProfileKeyedServiceFactory { ResourcePrefetchPredictorFactory(); virtual ~ResourcePrefetchPredictorFactory(); - // RefcountedProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // RefcountedBrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictorFactory); diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 70559d3..47de4d6 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc @@ -438,7 +438,8 @@ void MigrateBrowserPrefs(Profile* profile, PrefService* local_state) { } if (!(current_version & GOOGLE_URL_TRACKER_PREFS)) { - GoogleURLTrackerFactory::GetInstance()->RegisterUserPrefsOnProfile(profile); + GoogleURLTrackerFactory::GetInstance()->RegisterUserPrefsOnBrowserContext( + profile); registry->RegisterStringPref(prefs::kLastKnownGoogleURL, GoogleURLTracker::kDefaultGoogleHomepage); if (local_state->HasPrefPath(prefs::kLastKnownGoogleURL)) { diff --git a/chrome/browser/prerender/prerender_link_manager.h b/chrome/browser/prerender/prerender_link_manager.h index 9511fb9..b9987d8 100644 --- a/chrome/browser/prerender/prerender_link_manager.h +++ b/chrome/browser/prerender/prerender_link_manager.h @@ -35,7 +35,7 @@ class PrerenderManager; // being rendered in this chrome instance. It receives messages from the // renderer indicating addition, cancelation and abandonment of link elements, // and controls the PrerenderManager accordingly. -class PrerenderLinkManager : public ProfileKeyedService, +class PrerenderLinkManager : public BrowserContextKeyedService, public PrerenderHandle::Observer { public: explicit PrerenderLinkManager(PrerenderManager* manager); @@ -113,7 +113,7 @@ class PrerenderLinkManager : public ProfileKeyedService, void RemovePrerender(LinkPrerender* prerender); - // From ProfileKeyedService: + // From BrowserContextKeyedService: virtual void Shutdown() OVERRIDE; // From PrerenderHandle::Observer: diff --git a/chrome/browser/prerender/prerender_link_manager_factory.cc b/chrome/browser/prerender/prerender_link_manager_factory.cc index f6871fc..e93eeec 100644 --- a/chrome/browser/prerender/prerender_link_manager_factory.cc +++ b/chrome/browser/prerender/prerender_link_manager_factory.cc @@ -17,7 +17,7 @@ namespace prerender { PrerenderLinkManager* PrerenderLinkManagerFactory::GetForProfile( Profile* profile) { return static_cast<PrerenderLinkManager*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -26,12 +26,14 @@ PrerenderLinkManagerFactory* PrerenderLinkManagerFactory::GetInstance() { } PrerenderLinkManagerFactory::PrerenderLinkManagerFactory() - : ProfileKeyedServiceFactory("PrerenderLinkmanager", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "PrerenderLinkmanager", + BrowserContextDependencyManager::GetInstance()) { DependsOn(prerender::PrerenderManagerFactory::GetInstance()); } -ProfileKeyedService* PrerenderLinkManagerFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +PrerenderLinkManagerFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { PrerenderManager* prerender_manager = PrerenderManagerFactory::GetForProfile(static_cast<Profile*>(profile)); diff --git a/chrome/browser/prerender/prerender_link_manager_factory.h b/chrome/browser/prerender/prerender_link_manager_factory.h index 735ca00..3223c22 100644 --- a/chrome/browser/prerender/prerender_link_manager_factory.h +++ b/chrome/browser/prerender/prerender_link_manager_factory.h @@ -15,7 +15,7 @@ namespace prerender { class PrerenderLinkManager; -class PrerenderLinkManagerFactory : public ProfileKeyedServiceFactory { +class PrerenderLinkManagerFactory : public BrowserContextKeyedServiceFactory { public: static PrerenderLinkManager* GetForProfile(Profile* profile); static PrerenderLinkManagerFactory* GetInstance(); @@ -26,7 +26,7 @@ class PrerenderLinkManagerFactory : public ProfileKeyedServiceFactory { PrerenderLinkManagerFactory(); virtual ~PrerenderLinkManagerFactory() { } - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc index ec50600..dc1f780 100644 --- a/chrome/browser/prerender/prerender_manager.cc +++ b/chrome/browser/prerender/prerender_manager.cc @@ -283,8 +283,8 @@ PrerenderManager::PrerenderManager(Profile* profile, } PrerenderManager::~PrerenderManager() { - // The earlier call to ProfileKeyedService::Shutdown() should have emptied - // these vectors already. + // The earlier call to BrowserContextKeyedService::Shutdown() should have + // emptied these vectors already. DCHECK(active_prerenders_.empty()); DCHECK(to_delete_prerenders_.empty()); } diff --git a/chrome/browser/prerender/prerender_manager.h b/chrome/browser/prerender/prerender_manager.h index 74d28c9..b1153fc 100644 --- a/chrome/browser/prerender/prerender_manager.h +++ b/chrome/browser/prerender/prerender_manager.h @@ -78,7 +78,7 @@ class PrerenderTracker; class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>, public base::NonThreadSafe, public content::NotificationObserver, - public ProfileKeyedService { + public BrowserContextKeyedService { public: // NOTE: New values need to be appended, since they are used in histograms. enum PrerenderManagerMode { @@ -111,7 +111,7 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>, virtual ~PrerenderManager(); - // From ProfileKeyedService: + // From BrowserContextKeyedService: virtual void Shutdown() OVERRIDE; // Entry points for adding prerenders. diff --git a/chrome/browser/prerender/prerender_manager_factory.cc b/chrome/browser/prerender/prerender_manager_factory.cc index 171054a..60ea224 100644 --- a/chrome/browser/prerender/prerender_manager_factory.cc +++ b/chrome/browser/prerender/prerender_manager_factory.cc @@ -26,7 +26,7 @@ PrerenderManager* PrerenderManagerFactory::GetForProfile( if (!PrerenderManager::IsPrerenderingPossible()) return NULL; return static_cast<PrerenderManager*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -35,8 +35,9 @@ PrerenderManagerFactory* PrerenderManagerFactory::GetInstance() { } PrerenderManagerFactory::PrerenderManagerFactory() - : ProfileKeyedServiceFactory("PrerenderManager", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "PrerenderManager", + BrowserContextDependencyManager::GetInstance()) { DependsOn(extensions::ExtensionSystemFactory::GetInstance()); // PrerenderLocalPredictor observers the history visit DB. DependsOn(HistoryServiceFactory::GetInstance()); @@ -46,7 +47,7 @@ PrerenderManagerFactory::PrerenderManagerFactory() PrerenderManagerFactory::~PrerenderManagerFactory() { } -ProfileKeyedService* PrerenderManagerFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* PrerenderManagerFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { CHECK(g_browser_process->prerender_tracker()); PrerenderManager* prerender_manager = new PrerenderManager( diff --git a/chrome/browser/prerender/prerender_manager_factory.h b/chrome/browser/prerender/prerender_manager_factory.h index 9c6221c..65d4290 100644 --- a/chrome/browser/prerender/prerender_manager_factory.h +++ b/chrome/browser/prerender/prerender_manager_factory.h @@ -18,7 +18,7 @@ class PrerenderManager; // Singleton that owns all PrerenderManagers and associates them with Profiles. // Listens for the Profile's destruction notification and cleans up the // associated PrerenderManager. -class PrerenderManagerFactory : public ProfileKeyedServiceFactory { +class PrerenderManagerFactory : public BrowserContextKeyedServiceFactory { public: // Returns the PrerenderManager for |profile|. static PrerenderManager* GetForProfile(Profile* profile); @@ -31,8 +31,8 @@ class PrerenderManagerFactory : public ProfileKeyedServiceFactory { PrerenderManagerFactory(); virtual ~PrerenderManagerFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/prerender/prerender_unittest.cc b/chrome/browser/prerender/prerender_unittest.cc index 3e2e4fb..036742a 100644 --- a/chrome/browser/prerender/prerender_unittest.cc +++ b/chrome/browser/prerender/prerender_unittest.cc @@ -102,7 +102,7 @@ class UnitTestPrerenderManager : public PrerenderManager { virtual ~UnitTestPrerenderManager() { } - // From ProfileKeyedService, via PrererenderManager: + // From BrowserContextKeyedService, via PrererenderManager: virtual void Shutdown() OVERRIDE { if (next_prerender_contents()) next_prerender_contents_->Destroy(FINAL_STATUS_MANAGER_SHUTDOWN); diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h index 49dd7d4..7d8a54a 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h @@ -27,7 +27,7 @@ struct CloudPrintProxyInfo; // running in the service process. class CloudPrintProxyService : public CloudPrintSetupHandlerDelegate, - public ProfileKeyedService { + public BrowserContextKeyedService { public: explicit CloudPrintProxyService(Profile* profile); virtual ~CloudPrintProxyService(); diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc index c33c939..0e79f61 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc @@ -12,7 +12,7 @@ CloudPrintProxyService* CloudPrintProxyServiceFactory::GetForProfile( Profile* profile) { return static_cast<CloudPrintProxyService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } CloudPrintProxyServiceFactory* CloudPrintProxyServiceFactory::GetInstance() { @@ -20,14 +20,16 @@ CloudPrintProxyServiceFactory* CloudPrintProxyServiceFactory::GetInstance() { } CloudPrintProxyServiceFactory::CloudPrintProxyServiceFactory() - : ProfileKeyedServiceFactory("CloudPrintProxyService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "CloudPrintProxyService", + BrowserContextDependencyManager::GetInstance()) { } CloudPrintProxyServiceFactory::~CloudPrintProxyServiceFactory() { } -ProfileKeyedService* CloudPrintProxyServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +CloudPrintProxyServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { CloudPrintProxyService* service = new CloudPrintProxyService(static_cast<Profile*>(profile)); diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h index b320b48..a3e07b68 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h @@ -15,7 +15,7 @@ class Profile; // Singleton that owns all CloudPrintProxyServices and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated CloudPrintProxyService. -class CloudPrintProxyServiceFactory : public ProfileKeyedServiceFactory { +class CloudPrintProxyServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the CloudPrintProxyService for |profile|, creating if not yet // created. @@ -29,8 +29,8 @@ class CloudPrintProxyServiceFactory : public ProfileKeyedServiceFactory { CloudPrintProxyServiceFactory(); virtual ~CloudPrintProxyServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc index c92d30b..d6eefc5 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc @@ -422,7 +422,7 @@ TEST_F(CloudPrintProxyPolicyTest, prefs->GetString(prefs::kCloudPrintEmail)); } -ProfileKeyedService* TestCloudPrintProxyServiceFactory( +BrowserContextKeyedService* TestCloudPrintProxyServiceFactory( content::BrowserContext* profile) { TestCloudPrintProxyService* service = new TestCloudPrintProxyService(static_cast<Profile*>(profile)); diff --git a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc index 5658776..2f8de5e 100644 --- a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc +++ b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc @@ -455,7 +455,7 @@ TEST_F(CloudPrintProxyPolicyStartupTest, StartAndShutdown) { ShutdownAndWaitForExitWithTimeout(handle); } -ProfileKeyedService* CloudPrintProxyServiceFactoryForPolicyTest( +BrowserContextKeyedService* CloudPrintProxyServiceFactoryForPolicyTest( content::BrowserContext* profile) { CloudPrintProxyService* service = new CloudPrintProxyService(static_cast<Profile*>(profile)); diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc index fc33cdb..9f8c61e 100644 --- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc +++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc @@ -148,8 +148,8 @@ ChromeBrowserMainExtraPartsProfiles::~ChromeBrowserMainExtraPartsProfiles() { // FooServiceFactory here will scale or is desirable long term. // // static -void -ChromeBrowserMainExtraPartsProfiles::EnsureProfileKeyedServiceFactoriesBuilt() { +void ChromeBrowserMainExtraPartsProfiles:: +EnsureBrowserContextKeyedServiceFactoriesBuilt() { AboutSigninInternalsFactory::GetInstance(); autofill::PersonalDataManagerFactory::GetInstance(); #if defined(ENABLE_BACKGROUND) @@ -290,5 +290,5 @@ ChromeBrowserMainExtraPartsProfiles::EnsureProfileKeyedServiceFactoriesBuilt() { } void ChromeBrowserMainExtraPartsProfiles::PreProfileInit() { - EnsureProfileKeyedServiceFactoriesBuilt(); + EnsureBrowserContextKeyedServiceFactoriesBuilt(); } diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h index 1058102..e21f3d5 100644 --- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h +++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h @@ -20,10 +20,10 @@ class ChromeBrowserMainExtraPartsProfiles : public ChromeBrowserMainExtraParts { ChromeBrowserMainExtraPartsProfiles(); virtual ~ChromeBrowserMainExtraPartsProfiles(); - // Instantiates all chrome ProfileKeyedService factories, which is especially - // important for services that should be created at profile creation time - // as compared to lazily on first access. - static void EnsureProfileKeyedServiceFactoriesBuilt(); + // Instantiates all chrome BrowserContextKeyedService factories, which is + // especially important for services that should be created at profile + // creation time as compared to lazily on first access. + static void EnsureBrowserContextKeyedServiceFactoriesBuilt(); // Overridden from ChromeBrowserMainExtraParts: virtual void PreProfileInit() OVERRIDE; diff --git a/chrome/browser/profiles/gaia_info_update_service.h b/chrome/browser/profiles/gaia_info_update_service.h index d7694ed..797cc75 100644 --- a/chrome/browser/profiles/gaia_info_update_service.h +++ b/chrome/browser/profiles/gaia_info_update_service.h @@ -20,7 +20,7 @@ class ProfileDownloader; // This service kicks off a download of the user's name and profile picture. // The results are saved in the profile info cache. class GAIAInfoUpdateService : public ProfileDownloaderDelegate, - public ProfileKeyedService { + public BrowserContextKeyedService { public: explicit GAIAInfoUpdateService(Profile* profile); virtual ~GAIAInfoUpdateService(); diff --git a/chrome/browser/profiles/gaia_info_update_service_factory.cc b/chrome/browser/profiles/gaia_info_update_service_factory.cc index 72ea806..bc1e0fe 100644 --- a/chrome/browser/profiles/gaia_info_update_service_factory.cc +++ b/chrome/browser/profiles/gaia_info_update_service_factory.cc @@ -11,8 +11,9 @@ #include "components/user_prefs/pref_registry_syncable.h" GAIAInfoUpdateServiceFactory::GAIAInfoUpdateServiceFactory() - : ProfileKeyedServiceFactory("GAIAInfoUpdateService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "GAIAInfoUpdateService", + BrowserContextDependencyManager::GetInstance()) { } GAIAInfoUpdateServiceFactory::~GAIAInfoUpdateServiceFactory() {} @@ -21,7 +22,7 @@ GAIAInfoUpdateServiceFactory::~GAIAInfoUpdateServiceFactory() {} GAIAInfoUpdateService* GAIAInfoUpdateServiceFactory::GetForProfile( Profile* profile) { return static_cast<GAIAInfoUpdateService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -29,7 +30,8 @@ GAIAInfoUpdateServiceFactory* GAIAInfoUpdateServiceFactory::GetInstance() { return Singleton<GAIAInfoUpdateServiceFactory>::get(); } -ProfileKeyedService* GAIAInfoUpdateServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +GAIAInfoUpdateServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); if (!GAIAInfoUpdateService::ShouldUseGAIAProfileInfo(profile)) diff --git a/chrome/browser/profiles/gaia_info_update_service_factory.h b/chrome/browser/profiles/gaia_info_update_service_factory.h index e7df4d7..3ee9bd6 100644 --- a/chrome/browser/profiles/gaia_info_update_service_factory.h +++ b/chrome/browser/profiles/gaia_info_update_service_factory.h @@ -18,7 +18,7 @@ class PrefRegistrySyncable; // Singleton that owns all GAIAInfoUpdateServices and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated GAIAInfoUpdateService. -class GAIAInfoUpdateServiceFactory : public ProfileKeyedServiceFactory { +class GAIAInfoUpdateServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the instance of GAIAInfoUpdateService associated with this profile // (creating one if none exists). Returns NULL if this profile cannot have a @@ -34,8 +34,8 @@ class GAIAInfoUpdateServiceFactory : public ProfileKeyedServiceFactory { GAIAInfoUpdateServiceFactory(); virtual ~GAIAInfoUpdateServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; virtual void RegisterUserPrefs( diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc index 175ce97..842a30d 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl.cc +++ b/chrome/browser/profiles/off_the_record_profile_impl.cc @@ -94,7 +94,8 @@ OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) } void OffTheRecordProfileImpl::Init() { - ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); + BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( + this, false); extensions::ExtensionSystem::Get(this)->InitForOTRProfile(); @@ -140,7 +141,8 @@ OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { io_data_.GetResourceContextNoInit()); #endif - ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); + BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( + this); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, diff --git a/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc b/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc index 3c245c6..81e29f5 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc +++ b/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc @@ -145,7 +145,7 @@ TEST_F(OffTheRecordProfileImplTest, GetHostZoomMap) { new OffTheRecordProfileImpl(parent_profile.get())); child_profile->InitHostZoomMap(); - ProfileDependencyManager::GetInstance()->CreateProfileServices( + BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( child_profile.get(), false); // Prepare child host zoom map. diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index b7a34a4..6b8fa17 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -131,7 +131,7 @@ namespace { !defined(_GLIBCXX_DEBUG) // Make sure that the ProfileImpl doesn't grow. We're currently trying to drive // the number of services that are included in ProfileImpl (instead of using -// ProfileKeyedServiceFactory) to zero. +// BrowserContextKeyedServiceFactory) to zero. // // If you don't know about this effort, please read: // https://sites.google.com/a/chromium.org/dev/developers/design-documents/profile-architecture @@ -629,7 +629,8 @@ ProfileImpl::~ProfileImpl() { ClearAllIncognitoSessionOnlyPreferences(); } - ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); + BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( + this); if (top_sites_) top_sites_->Shutdown(); @@ -733,7 +734,8 @@ void ProfileImpl::OnPrefsLoaded(bool success) { // TODO(sky): remove this in a couple of releases (m28ish). prefs_->SetBoolean(prefs::kSessionExitedCleanly, true); - ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); + BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( + this, false); DCHECK(!net_pref_observer_); net_pref_observer_.reset(new NetPrefObserver( @@ -861,9 +863,9 @@ ProfileImpl::CreateRequestContextForStoragePartition( net::SSLConfigService* ProfileImpl::GetSSLConfigService() { // If ssl_config_service_manager_ is null, this typically means that some - // ProfileKeyedService is trying to create a RequestContext at startup, but - // SSLConfigServiceManager is not initialized until DoFinalInit() which is - // invoked after all ProfileKeyedServices have been initialized (see + // BrowserContextKeyedService is trying to create a RequestContext at startup, + // but SSLConfigServiceManager is not initialized until DoFinalInit() which is + // invoked after all BrowserContextKeyedServices have been initialized (see // http://crbug.com/171406). DCHECK(ssl_config_service_manager_) << "SSLConfigServiceManager is not initialized yet"; diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h index a677ecd..6f4f415 100644 --- a/chrome/browser/profiles/profile_impl.h +++ b/chrome/browser/profiles/profile_impl.h @@ -203,7 +203,7 @@ class ProfileImpl : public Profile { // TODO(mnissler, joaodasilva): The |profile_policy_connector_| provides the // PolicyService that the |prefs_| depend on, and must outlive |prefs_|. - // This can be removed once |prefs_| becomes a ProfileKeyedService too. + // This can be removed once |prefs_| becomes a BrowserContextKeyedService too. // |profile_policy_connector_| in turn depends on |cloud_policy_manager_|. #if defined(ENABLE_CONFIGURATION_POLICY) scoped_ptr<policy::CloudPolicyManager> cloud_policy_manager_; @@ -253,16 +253,16 @@ class ProfileImpl : public Profile { // STOP!!!! DO NOT ADD ANY MORE ITEMS HERE!!!! // // Instead, make your Service/Manager/whatever object you're hanging off the - // Profile use our new ProfileKeyedServiceFactory system instead. You can - // find the design document here: + // Profile use our new BrowserContextKeyedServiceFactory system instead. + // You can find the design document here: // // https://sites.google.com/a/chromium.org/dev/developers/design-documents/profile-architecture // // and you can read the raw headers here: // - // chrome/browser/profile/profile_keyed_service.h - // chrome/browser/profile/profile_keyed_service_factory.{h,cc} - // chrome/browser/profile/profile_keyed_dependency_manager.{h,cc} + // components/browser_context_keyed_service/browser_context_dependency_manager.{h,cc} + // components/browser_context_keyed_service/browser_context_keyed_service.h + // components/browser_context_keyed_service/browser_context_keyed_service_factory.{h,cc} Profile::Delegate* delegate_; diff --git a/chrome/browser/profiles/startup_task_runner_service.h b/chrome/browser/profiles/startup_task_runner_service.h index b94f078..11c5931 100644 --- a/chrome/browser/profiles/startup_task_runner_service.h +++ b/chrome/browser/profiles/startup_task_runner_service.h @@ -18,7 +18,7 @@ class DeferredSequencedTaskRunner; // This service manages the startup task runners. class StartupTaskRunnerService : public base::NonThreadSafe, - public ProfileKeyedService { + public BrowserContextKeyedService { public: explicit StartupTaskRunnerService(Profile* profile); virtual ~StartupTaskRunnerService(); diff --git a/chrome/browser/profiles/startup_task_runner_service_factory.cc b/chrome/browser/profiles/startup_task_runner_service_factory.cc index 24e50ad..fcf1215 100644 --- a/chrome/browser/profiles/startup_task_runner_service_factory.cc +++ b/chrome/browser/profiles/startup_task_runner_service_factory.cc @@ -9,8 +9,9 @@ #include "components/browser_context_keyed_service/browser_context_dependency_manager.h" StartupTaskRunnerServiceFactory::StartupTaskRunnerServiceFactory() - : ProfileKeyedServiceFactory("StartupTaskRunnerServiceFactory", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "StartupTaskRunnerServiceFactory", + BrowserContextDependencyManager::GetInstance()) { } StartupTaskRunnerServiceFactory::~StartupTaskRunnerServiceFactory() {} @@ -19,7 +20,7 @@ StartupTaskRunnerServiceFactory::~StartupTaskRunnerServiceFactory() {} StartupTaskRunnerService* StartupTaskRunnerServiceFactory::GetForProfile( Profile* profile) { return static_cast<StartupTaskRunnerService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -28,7 +29,8 @@ StartupTaskRunnerServiceFactory* return Singleton<StartupTaskRunnerServiceFactory>::get(); } -ProfileKeyedService* StartupTaskRunnerServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +StartupTaskRunnerServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new StartupTaskRunnerService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/profiles/startup_task_runner_service_factory.h b/chrome/browser/profiles/startup_task_runner_service_factory.h index 1876c63..d43507e 100644 --- a/chrome/browser/profiles/startup_task_runner_service_factory.h +++ b/chrome/browser/profiles/startup_task_runner_service_factory.h @@ -14,7 +14,8 @@ class PrefRegistrySyncable; class Profile; // Singleton that owns the start-up task runner service. -class StartupTaskRunnerServiceFactory : public ProfileKeyedServiceFactory { +class StartupTaskRunnerServiceFactory + : public BrowserContextKeyedServiceFactory { public: // Returns the instance of StartupTaskRunnerService associated with this // profile (creating one if none exists). @@ -29,8 +30,8 @@ class StartupTaskRunnerServiceFactory : public ProfileKeyedServiceFactory { StartupTaskRunnerServiceFactory(); virtual ~StartupTaskRunnerServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(StartupTaskRunnerServiceFactory); diff --git a/chrome/browser/search/instant_service.h b/chrome/browser/search/instant_service.h index a3d5fb4..78a87db 100644 --- a/chrome/browser/search/instant_service.h +++ b/chrome/browser/search/instant_service.h @@ -26,7 +26,7 @@ class URLRequest; } // Tracks render process host IDs that are associated with Instant. -class InstantService : public ProfileKeyedService, +class InstantService : public BrowserContextKeyedService, public content::NotificationObserver { public: explicit InstantService(Profile* profile); @@ -74,7 +74,7 @@ class InstantService : public ProfileKeyedService, InstantMostVisitedItem* item) const; private: - // Overridden from ProfileKeyedService: + // Overridden from BrowserContextKeyedService: virtual void Shutdown() OVERRIDE; // Overridden from content::NotificationObserver: diff --git a/chrome/browser/search/instant_service_factory.cc b/chrome/browser/search/instant_service_factory.cc index f4b6daa..a156295 100644 --- a/chrome/browser/search/instant_service_factory.cc +++ b/chrome/browser/search/instant_service_factory.cc @@ -12,7 +12,7 @@ // static InstantService* InstantServiceFactory::GetForProfile(Profile* profile) { return static_cast<InstantService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -21,8 +21,9 @@ InstantServiceFactory* InstantServiceFactory::GetInstance() { } InstantServiceFactory::InstantServiceFactory() - : ProfileKeyedServiceFactory("InstantService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "InstantService", + BrowserContextDependencyManager::GetInstance()) { // No dependencies. } @@ -34,7 +35,7 @@ content::BrowserContext* InstantServiceFactory::GetBrowserContextToUse( return chrome::GetBrowserContextOwnInstanceInIncognito(context); } -ProfileKeyedService* InstantServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* InstantServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new InstantService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/search/instant_service_factory.h b/chrome/browser/search/instant_service_factory.h index 0c31f05..4d9c584 100644 --- a/chrome/browser/search/instant_service_factory.h +++ b/chrome/browser/search/instant_service_factory.h @@ -12,10 +12,10 @@ class InstantService; class Profile; -class ProfileKeyedService; +class BrowserContextKeyedService; // Singleton that owns all InstantServices and associates them with Profiles. -class InstantServiceFactory : public ProfileKeyedServiceFactory { +class InstantServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the InstantService for |profile|. static InstantService* GetForProfile(Profile* profile); @@ -28,10 +28,10 @@ class InstantServiceFactory : public ProfileKeyedServiceFactory { InstantServiceFactory(); virtual ~InstantServiceFactory(); - // Overridden from ProfileKeyedServiceFactory: + // Overridden from BrowserContextKeyedServiceFactory: virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(InstantServiceFactory); diff --git a/chrome/browser/search_engines/template_url_fetcher.h b/chrome/browser/search_engines/template_url_fetcher.h index 5e51cc7..4b43aab 100644 --- a/chrome/browser/search_engines/template_url_fetcher.h +++ b/chrome/browser/search_engines/template_url_fetcher.h @@ -23,7 +23,7 @@ class WebContents; // documents, creating a TemplateURL from the OSDD, and adding the TemplateURL // to the TemplateURLService. Downloading is done in the background. // -class TemplateURLFetcher : public ProfileKeyedService { +class TemplateURLFetcher : public BrowserContextKeyedService { public: enum ProviderType { AUTODETECTED_PROVIDER, diff --git a/chrome/browser/search_engines/template_url_fetcher_factory.cc b/chrome/browser/search_engines/template_url_fetcher_factory.cc index 256b198..1e0849e 100644 --- a/chrome/browser/search_engines/template_url_fetcher_factory.cc +++ b/chrome/browser/search_engines/template_url_fetcher_factory.cc @@ -14,7 +14,7 @@ TemplateURLFetcher* TemplateURLFetcherFactory::GetForProfile( Profile* profile) { return static_cast<TemplateURLFetcher*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -25,20 +25,21 @@ TemplateURLFetcherFactory* TemplateURLFetcherFactory::GetInstance() { // static void TemplateURLFetcherFactory::ShutdownForProfile(Profile* profile) { TemplateURLFetcherFactory* factory = GetInstance(); - factory->ProfileShutdown(profile); - factory->ProfileDestroyed(profile); + factory->BrowserContextShutdown(profile); + factory->BrowserContextDestroyed(profile); } TemplateURLFetcherFactory::TemplateURLFetcherFactory() - : ProfileKeyedServiceFactory("TemplateURLFetcher", - ProfileDependencyManager::GetInstance()) { - DependsOn(TemplateURLServiceFactory::GetInstance()); + : BrowserContextKeyedServiceFactory( + "TemplateURLFetcher", + BrowserContextDependencyManager::GetInstance()) { + DependsOn(TemplateURLServiceFactory::GetInstance()); } TemplateURLFetcherFactory::~TemplateURLFetcherFactory() { } -ProfileKeyedService* TemplateURLFetcherFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* TemplateURLFetcherFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new TemplateURLFetcher(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/search_engines/template_url_fetcher_factory.h b/chrome/browser/search_engines/template_url_fetcher_factory.h index 7d19505..7c8174c 100644 --- a/chrome/browser/search_engines/template_url_fetcher_factory.h +++ b/chrome/browser/search_engines/template_url_fetcher_factory.h @@ -13,7 +13,7 @@ class TemplateURLFetcher; // Singleton that owns all TemplateURLFetcher and associates them with // Profiles. -class TemplateURLFetcherFactory : public ProfileKeyedServiceFactory { +class TemplateURLFetcherFactory : public BrowserContextKeyedServiceFactory { public: static TemplateURLFetcher* GetForProfile(Profile* profile); @@ -30,8 +30,8 @@ class TemplateURLFetcherFactory : public ProfileKeyedServiceFactory { TemplateURLFetcherFactory(); virtual ~TemplateURLFetcherFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc index 63cf81f..8c78bd3 100644 --- a/chrome/browser/search_engines/template_url_service.cc +++ b/chrome/browser/search_engines/template_url_service.cc @@ -878,7 +878,7 @@ void TemplateURLService::Observe(int type, void TemplateURLService::Shutdown() { // This check has to be done at Shutdown() instead of in the dtor to ensure // that no clients of WebDataService are holding ptrs to it after the first - // phase of the ProfileKeyedService Shutdown() process. + // phase of the BrowserContextKeyedService Shutdown() process. if (load_handle_) { DCHECK(service_.get()); service_->CancelRequest(load_handle_); diff --git a/chrome/browser/search_engines/template_url_service.h b/chrome/browser/search_engines/template_url_service.h index 2b8f5a2..adabac7 100644 --- a/chrome/browser/search_engines/template_url_service.h +++ b/chrome/browser/search_engines/template_url_service.h @@ -61,7 +61,7 @@ struct URLVisitedDetails; // TemplateURLService handles deletion. class TemplateURLService : public WebDataServiceConsumer, - public ProfileKeyedService, + public BrowserContextKeyedService, public content::NotificationObserver, public syncer::SyncableService { public: @@ -261,7 +261,7 @@ class TemplateURLService : public WebDataServiceConsumer, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // syncer::SyncableService implementation. diff --git a/chrome/browser/search_engines/template_url_service_factory.cc b/chrome/browser/search_engines/template_url_service_factory.cc index dc66f38..3b1c8d7 100644 --- a/chrome/browser/search_engines/template_url_service_factory.cc +++ b/chrome/browser/search_engines/template_url_service_factory.cc @@ -17,7 +17,7 @@ // static TemplateURLService* TemplateURLServiceFactory::GetForProfile(Profile* profile) { return static_cast<TemplateURLService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -26,14 +26,15 @@ TemplateURLServiceFactory* TemplateURLServiceFactory::GetInstance() { } // static -ProfileKeyedService* TemplateURLServiceFactory::BuildInstanceFor( +BrowserContextKeyedService* TemplateURLServiceFactory::BuildInstanceFor( content::BrowserContext* profile) { return new TemplateURLService(static_cast<Profile*>(profile)); } TemplateURLServiceFactory::TemplateURLServiceFactory() - : ProfileKeyedServiceFactory("TemplateURLServiceFactory", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "TemplateURLServiceFactory", + BrowserContextDependencyManager::GetInstance()) { DependsOn(GoogleURLTrackerFactory::GetInstance()); DependsOn(HistoryServiceFactory::GetInstance()); DependsOn(WebDataServiceFactory::GetInstance()); @@ -41,7 +42,7 @@ TemplateURLServiceFactory::TemplateURLServiceFactory() TemplateURLServiceFactory::~TemplateURLServiceFactory() {} -ProfileKeyedService* TemplateURLServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* TemplateURLServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return BuildInstanceFor(static_cast<Profile*>(profile)); } @@ -112,17 +113,17 @@ bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const { return true; } -void TemplateURLServiceFactory::ProfileShutdown( +void TemplateURLServiceFactory::BrowserContextShutdown( content::BrowserContext* profile) { // We shutdown AND destroy the TemplateURLService during this pass. // TemplateURLService schedules a task on the WebDataService from its // destructor. Delete it first to ensure the task gets scheduled before we // shut down the database. - ProfileKeyedServiceFactory::ProfileShutdown(profile); - ProfileKeyedServiceFactory::ProfileDestroyed(profile); + BrowserContextKeyedServiceFactory::BrowserContextShutdown(profile); + BrowserContextKeyedServiceFactory::BrowserContextDestroyed(profile); } -void TemplateURLServiceFactory::ProfileDestroyed( +void TemplateURLServiceFactory::BrowserContextDestroyed( content::BrowserContext* profile) { // Don't double delete. } diff --git a/chrome/browser/search_engines/template_url_service_factory.h b/chrome/browser/search_engines/template_url_service_factory.h index 81912de..db46263 100644 --- a/chrome/browser/search_engines/template_url_service_factory.h +++ b/chrome/browser/search_engines/template_url_service_factory.h @@ -13,13 +13,13 @@ class TemplateURLService; // Singleton that owns all TemplateURLService and associates them with // Profiles. -class TemplateURLServiceFactory : public ProfileKeyedServiceFactory { +class TemplateURLServiceFactory : public BrowserContextKeyedServiceFactory { public: static TemplateURLService* GetForProfile(Profile* profile); static TemplateURLServiceFactory* GetInstance(); - static ProfileKeyedService* BuildInstanceFor( + static BrowserContextKeyedService* BuildInstanceFor( content::BrowserContext* profile); private: @@ -28,16 +28,18 @@ class TemplateURLServiceFactory : public ProfileKeyedServiceFactory { TemplateURLServiceFactory(); virtual ~TemplateURLServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; - virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE; - virtual void ProfileDestroyed(content::BrowserContext* profile) OVERRIDE; + virtual void BrowserContextShutdown( + content::BrowserContext* profile) OVERRIDE; + virtual void BrowserContextDestroyed( + content::BrowserContext* profile) OVERRIDE; }; #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_FACTORY_H_ diff --git a/chrome/browser/search_engines/template_url_service_sync_unittest.cc b/chrome/browser/search_engines/template_url_service_sync_unittest.cc index 4148118b..86ce43c 100644 --- a/chrome/browser/search_engines/template_url_service_sync_unittest.cc +++ b/chrome/browser/search_engines/template_url_service_sync_unittest.cc @@ -259,7 +259,7 @@ void TemplateURLServiceSyncTest::SetUp() { // just foul them up). test_util_a_.ChangeModelToLoadState(); profile_b_.reset(new TestingProfile); - TemplateURLServiceFactory::GetInstance()->RegisterUserPrefsOnProfile( + TemplateURLServiceFactory::GetInstance()->RegisterUserPrefsOnBrowserContext( profile_b_.get()); model_b_.reset(new TemplateURLService(profile_b_.get())); model_b_->Load(); diff --git a/chrome/browser/search_engines/template_url_service_test_util.cc b/chrome/browser/search_engines/template_url_service_test_util.cc index e464e43..5336300 100644 --- a/chrome/browser/search_engines/template_url_service_test_util.cc +++ b/chrome/browser/search_engines/template_url_service_test_util.cc @@ -56,7 +56,7 @@ static void WaitForThreadToProcessRequests(BrowserThread::ID identifier) { // SetKeywordSearchTermsForURL. class TestingTemplateURLService : public TemplateURLService { public: - static ProfileKeyedService* Build(content::BrowserContext* profile) { + static BrowserContextKeyedService* Build(content::BrowserContext* profile) { return new TestingTemplateURLService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/sessions/in_memory_tab_restore_service.cc b/chrome/browser/sessions/in_memory_tab_restore_service.cc index 82afb69..f44b7a7 100644 --- a/chrome/browser/sessions/in_memory_tab_restore_service.cc +++ b/chrome/browser/sessions/in_memory_tab_restore_service.cc @@ -86,7 +86,7 @@ void InMemoryTabRestoreService::DeleteLastSession() { void InMemoryTabRestoreService::Shutdown() { } -ProfileKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new InMemoryTabRestoreService(static_cast<Profile*>(profile), NULL); } diff --git a/chrome/browser/sessions/persistent_tab_restore_service.cc b/chrome/browser/sessions/persistent_tab_restore_service.cc index 8f561f6..39ae99f 100644 --- a/chrome/browser/sessions/persistent_tab_restore_service.cc +++ b/chrome/browser/sessions/persistent_tab_restore_service.cc @@ -985,7 +985,7 @@ void PersistentTabRestoreService::PruneEntries() { helper_.PruneEntries(); } -ProfileKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new PersistentTabRestoreService(static_cast<Profile*>(profile), NULL); } diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index 04f85b1..4727415 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc @@ -203,7 +203,7 @@ SessionService::SessionService(const base::FilePath& save_path) SessionService::~SessionService() { // The BrowserList should outlive the SessionService since it's static and - // the SessionService is a ProfileKeyedService. + // the SessionService is a BrowserContextKeyedService. BrowserList::RemoveObserver(this); Save(); } diff --git a/chrome/browser/sessions/session_service.h b/chrome/browser/sessions/session_service.h index 9aa049d..69992e4 100644 --- a/chrome/browser/sessions/session_service.h +++ b/chrome/browser/sessions/session_service.h @@ -55,7 +55,7 @@ class WebContents; // SessionService rebuilds the contents of the file from the open state of the // browser. class SessionService : public BaseSessionService, - public ProfileKeyedService, + public BrowserContextKeyedService, public content::NotificationObserver, public chrome::BrowserListObserver { friend class SessionServiceTestHelper; diff --git a/chrome/browser/sessions/session_service_factory.cc b/chrome/browser/sessions/session_service_factory.cc index 3cbd0fb..05cf198 100644 --- a/chrome/browser/sessions/session_service_factory.cc +++ b/chrome/browser/sessions/session_service_factory.cc @@ -15,7 +15,7 @@ SessionService* SessionServiceFactory::GetForProfile(Profile* profile) { return NULL; #else return static_cast<SessionService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); #endif } @@ -27,7 +27,7 @@ SessionService* SessionServiceFactory::GetForProfileIfExisting( return NULL; #else return static_cast<SessionService*>( - GetInstance()->GetServiceForProfile(profile, false)); + GetInstance()->GetServiceForBrowserContext(profile, false)); #endif } @@ -37,12 +37,12 @@ void SessionServiceFactory::ShutdownForProfile(Profile* profile) { // been created yet. We do this to ensure session state matches the point in // time the user exited. SessionServiceFactory* factory = GetInstance(); - factory->GetServiceForProfile(profile, true); + factory->GetServiceForBrowserContext(profile, true); // Shut down and remove the reference to the session service, and replace it // with an explicit NULL to prevent it being recreated on the next access. - factory->ProfileShutdown(profile); - factory->ProfileDestroyed(profile); + factory->BrowserContextShutdown(profile); + factory->BrowserContextDestroyed(profile); factory->Associate(profile, NULL); } @@ -51,14 +51,15 @@ SessionServiceFactory* SessionServiceFactory::GetInstance() { } SessionServiceFactory::SessionServiceFactory() - : ProfileKeyedServiceFactory("SessionService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "SessionService", + BrowserContextDependencyManager::GetInstance()) { } SessionServiceFactory::~SessionServiceFactory() { } -ProfileKeyedService* SessionServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* SessionServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { SessionService* service = NULL; service = new SessionService(static_cast<Profile*>(profile)); @@ -66,7 +67,7 @@ ProfileKeyedService* SessionServiceFactory::BuildServiceInstanceFor( return service; } -bool SessionServiceFactory::ServiceIsCreatedWithProfile() const { +bool SessionServiceFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/sessions/session_service_factory.h b/chrome/browser/sessions/session_service_factory.h index 9e72a58..a8661a5 100644 --- a/chrome/browser/sessions/session_service_factory.h +++ b/chrome/browser/sessions/session_service_factory.h @@ -14,7 +14,7 @@ class Profile; // Singleton that owns all SessionServices and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated SessionService. -class SessionServiceFactory : public ProfileKeyedServiceFactory { +class SessionServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the session service for |profile|. This may return NULL. If this // profile supports a session service (it isn't incognito), and the session @@ -40,8 +40,8 @@ class SessionServiceFactory : public ProfileKeyedServiceFactory { // For test use: force setting of the session service for a given profile. // This will delete a previous session service for this profile if it exists. static void SetForTestProfile(Profile* profile, SessionService* service) { - GetInstance()->ProfileShutdown(profile); - GetInstance()->ProfileDestroyed(profile); + GetInstance()->BrowserContextShutdown(profile); + GetInstance()->BrowserContextDestroyed(profile); GetInstance()->Associate(profile, service); } #endif @@ -54,10 +54,10 @@ class SessionServiceFactory : public ProfileKeyedServiceFactory { SessionServiceFactory(); virtual ~SessionServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/sessions/tab_restore_service.h b/chrome/browser/sessions/tab_restore_service.h index 69edad5..210ba2f 100644 --- a/chrome/browser/sessions/tab_restore_service.h +++ b/chrome/browser/sessions/tab_restore_service.h @@ -38,7 +38,7 @@ class WebContents; // // To listen for changes to the set of entries managed by the TabRestoreService // add an observer. -class TabRestoreService : public ProfileKeyedService { +class TabRestoreService : public BrowserContextKeyedService { public: // Interface used to allow the test to provide a custom time. class TimeFactory { diff --git a/chrome/browser/sessions/tab_restore_service_factory.cc b/chrome/browser/sessions/tab_restore_service_factory.cc index 1daa2c9..0cf92c7 100644 --- a/chrome/browser/sessions/tab_restore_service_factory.cc +++ b/chrome/browser/sessions/tab_restore_service_factory.cc @@ -11,21 +11,21 @@ // static TabRestoreService* TabRestoreServiceFactory::GetForProfile(Profile* profile) { return static_cast<TabRestoreService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static TabRestoreService* TabRestoreServiceFactory::GetForProfileIfExisting( Profile* profile) { return static_cast<TabRestoreService*>( - GetInstance()->GetServiceForProfile(profile, false)); + GetInstance()->GetServiceForBrowserContext(profile, false)); } // static void TabRestoreServiceFactory::ResetForProfile(Profile* profile) { TabRestoreServiceFactory* factory = GetInstance(); - factory->ProfileShutdown(profile); - factory->ProfileDestroyed(profile); + factory->BrowserContextShutdown(profile); + factory->BrowserContextDestroyed(profile); } TabRestoreServiceFactory* TabRestoreServiceFactory::GetInstance() { @@ -33,8 +33,9 @@ TabRestoreServiceFactory* TabRestoreServiceFactory::GetInstance() { } TabRestoreServiceFactory::TabRestoreServiceFactory() - : ProfileKeyedServiceFactory("TabRestoreService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "TabRestoreService", + BrowserContextDependencyManager::GetInstance()) { } TabRestoreServiceFactory::~TabRestoreServiceFactory() { diff --git a/chrome/browser/sessions/tab_restore_service_factory.h b/chrome/browser/sessions/tab_restore_service_factory.h index d1eec59..8908e97 100644 --- a/chrome/browser/sessions/tab_restore_service_factory.h +++ b/chrome/browser/sessions/tab_restore_service_factory.h @@ -14,7 +14,7 @@ class Profile; // Singleton that owns all TabRestoreServices and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated TabRestoreService. -class TabRestoreServiceFactory : public ProfileKeyedServiceFactory { +class TabRestoreServiceFactory : public BrowserContextKeyedServiceFactory { public: static TabRestoreService* GetForProfile(Profile* profile); @@ -32,8 +32,8 @@ class TabRestoreServiceFactory : public ProfileKeyedServiceFactory { TabRestoreServiceFactory(); virtual ~TabRestoreServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/signin/about_signin_internals.h b/chrome/browser/signin/about_signin_internals.h index 971ffb6..4dfa1d8 100644 --- a/chrome/browser/signin/about_signin_internals.h +++ b/chrome/browser/signin/about_signin_internals.h @@ -22,7 +22,7 @@ class Profile; // This class collects authentication, signin and token information // to propagate to about:signin-internals via SigninInternalsUI. class AboutSigninInternals - : public ProfileKeyedService, + : public BrowserContextKeyedService, public signin_internals_util::SigninDiagnosticsObserver { public: class Observer { @@ -63,7 +63,7 @@ class AboutSigninInternals void Initialize(Profile* profile); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // Returns a dictionary of values in signin_status_ for use in diff --git a/chrome/browser/signin/about_signin_internals_factory.cc b/chrome/browser/signin/about_signin_internals_factory.cc index 6d88899..4ff1c09 100644 --- a/chrome/browser/signin/about_signin_internals_factory.cc +++ b/chrome/browser/signin/about_signin_internals_factory.cc @@ -16,8 +16,9 @@ using namespace signin_internals_util; AboutSigninInternalsFactory::AboutSigninInternalsFactory() - : ProfileKeyedServiceFactory("AboutSigninInternals", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "AboutSigninInternals", + BrowserContextDependencyManager::GetInstance()) { DependsOn(SigninManagerFactory::GetInstance()); DependsOn(TokenServiceFactory::GetInstance()); } @@ -28,7 +29,7 @@ AboutSigninInternalsFactory::~AboutSigninInternalsFactory() {} AboutSigninInternals* AboutSigninInternalsFactory::GetForProfile( Profile* profile) { return static_cast<AboutSigninInternals*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -87,7 +88,8 @@ void AboutSigninInternalsFactory::RegisterUserPrefs( } } -ProfileKeyedService* AboutSigninInternalsFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +AboutSigninInternalsFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { AboutSigninInternals* service = new AboutSigninInternals(); service->Initialize(static_cast<Profile*>(profile)); diff --git a/chrome/browser/signin/about_signin_internals_factory.h b/chrome/browser/signin/about_signin_internals_factory.h index 9414dc8..c362aac 100644 --- a/chrome/browser/signin/about_signin_internals_factory.h +++ b/chrome/browser/signin/about_signin_internals_factory.h @@ -13,7 +13,7 @@ class Profile; // Singleton that owns all AboutSigninInternals and associates them with // Profiles. -class AboutSigninInternalsFactory : public ProfileKeyedServiceFactory { +class AboutSigninInternalsFactory : public BrowserContextKeyedServiceFactory { public: // Returns the instance of AboutSigninInternals associated with this profile, // creating one if none exists. @@ -22,7 +22,7 @@ class AboutSigninInternalsFactory : public ProfileKeyedServiceFactory { // Returns an instance of the AboutSigninInternalsFactory singleton. static AboutSigninInternalsFactory* GetInstance(); - // Implementation of ProfileKeyedServiceFactory. + // Implementation of BrowserContextKeyedServiceFactory. virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; @@ -32,8 +32,8 @@ class AboutSigninInternalsFactory : public ProfileKeyedServiceFactory { AboutSigninInternalsFactory(); virtual ~AboutSigninInternalsFactory(); - // ProfileKeyedServiceFactory - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/signin/fake_signin_manager.cc b/chrome/browser/signin/fake_signin_manager.cc index 5fcecec..43d5306 100644 --- a/chrome/browser/signin/fake_signin_manager.cc +++ b/chrome/browser/signin/fake_signin_manager.cc @@ -25,7 +25,7 @@ void FakeSigninManagerBase::InitTokenService() { } // static -ProfileKeyedService* FakeSigninManagerBase::Build( +BrowserContextKeyedService* FakeSigninManagerBase::Build( content::BrowserContext* profile) { return new FakeSigninManagerBase(); } @@ -77,7 +77,7 @@ void FakeSigninManager::SignOut() { } // static -ProfileKeyedService* FakeSigninManager::Build( +BrowserContextKeyedService* FakeSigninManager::Build( content::BrowserContext* profile) { return new FakeSigninManager(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/signin/fake_signin_manager.h b/chrome/browser/signin/fake_signin_manager.h index 11ea384..adb9b9bf 100644 --- a/chrome/browser/signin/fake_signin_manager.h +++ b/chrome/browser/signin/fake_signin_manager.h @@ -11,7 +11,7 @@ #include "chrome/browser/signin/signin_manager.h" class Profile; -class ProfileKeyedService; +class BrowserContextKeyedService; // Overrides InitTokenService to do-nothing in tests. class FakeSigninManagerBase : public SigninManagerBase { @@ -21,8 +21,9 @@ class FakeSigninManagerBase : public SigninManagerBase { virtual void InitTokenService() OVERRIDE; - // Helper function to be used with ProfileKeyedService::SetTestingFactory(). - static ProfileKeyedService* Build(content::BrowserContext* profile); + // Helper function to be used with + // BrowserContextKeyedService::SetTestingFactory(). + static BrowserContextKeyedService* Build(content::BrowserContext* profile); }; #if !defined(OS_CHROMEOS) @@ -53,8 +54,9 @@ class FakeSigninManager : public SigninManager { virtual void CompletePendingSignin() OVERRIDE; - // Helper function to be used with ProfileKeyedService::SetTestingFactory(). - static ProfileKeyedService* Build(content::BrowserContext* profile); + // Helper function to be used with + // BrowserContextKeyedService::SetTestingFactory(). + static BrowserContextKeyedService* Build(content::BrowserContext* profile); }; #endif // !defined (OS_CHROMEOS) diff --git a/chrome/browser/signin/profile_oauth2_token_service.h b/chrome/browser/signin/profile_oauth2_token_service.h index 393b50c..b4054a1 100644 --- a/chrome/browser/signin/profile_oauth2_token_service.h +++ b/chrome/browser/signin/profile_oauth2_token_service.h @@ -22,7 +22,7 @@ class GoogleServiceAuthError; class Profile; class TokenService; -// ProfileOAuth2TokenService is a ProfileKeyedService that retrieves +// ProfileOAuth2TokenService is a BrowserContextKeyedService that retrieves // OAuth2 access tokens for a given set of scopes using the OAuth2 login // refresh token maintained by TokenService. // @@ -39,7 +39,7 @@ class TokenService; class ProfileOAuth2TokenService : public OAuth2TokenService, public content::NotificationObserver, public SigninGlobalError::AuthStatusProvider, - public ProfileKeyedService { + public BrowserContextKeyedService { public: // content::NotificationObserver listening for TokenService updates. virtual void Observe(int type, @@ -49,7 +49,7 @@ class ProfileOAuth2TokenService : public OAuth2TokenService, // Initializes this token service with the profile. virtual void Initialize(Profile* profile); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // SigninGlobalError::AuthStatusProvider implementation. diff --git a/chrome/browser/signin/profile_oauth2_token_service_factory.cc b/chrome/browser/signin/profile_oauth2_token_service_factory.cc index f6ce724..97687dc 100644 --- a/chrome/browser/signin/profile_oauth2_token_service_factory.cc +++ b/chrome/browser/signin/profile_oauth2_token_service_factory.cc @@ -15,8 +15,9 @@ #endif ProfileOAuth2TokenServiceFactory::ProfileOAuth2TokenServiceFactory() - : ProfileKeyedServiceFactory("ProfileOAuth2TokenService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ProfileOAuth2TokenService", + BrowserContextDependencyManager::GetInstance()) { DependsOn(SigninManagerFactory::GetInstance()); DependsOn(TokenServiceFactory::GetInstance()); } @@ -28,7 +29,7 @@ ProfileOAuth2TokenServiceFactory::~ProfileOAuth2TokenServiceFactory() { ProfileOAuth2TokenService* ProfileOAuth2TokenServiceFactory::GetForProfile( Profile* profile) { return static_cast<ProfileOAuth2TokenService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -37,7 +38,8 @@ ProfileOAuth2TokenServiceFactory* return Singleton<ProfileOAuth2TokenServiceFactory>::get(); } -ProfileKeyedService* ProfileOAuth2TokenServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +ProfileOAuth2TokenServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); ProfileOAuth2TokenService* service; diff --git a/chrome/browser/signin/profile_oauth2_token_service_factory.h b/chrome/browser/signin/profile_oauth2_token_service_factory.h index 9b56e3e..9051758 100644 --- a/chrome/browser/signin/profile_oauth2_token_service_factory.h +++ b/chrome/browser/signin/profile_oauth2_token_service_factory.h @@ -14,7 +14,8 @@ class Profile; // Singleton that owns all ProfileOAuth2TokenServices and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated ProfileOAuth2TokenService. -class ProfileOAuth2TokenServiceFactory : public ProfileKeyedServiceFactory { +class ProfileOAuth2TokenServiceFactory + : public BrowserContextKeyedServiceFactory { public: // Returns the instance of ProfileOAuth2TokenService associated with this // profile (creating one if none exists). Returns NULL if this profile @@ -32,8 +33,8 @@ class ProfileOAuth2TokenServiceFactory : public ProfileKeyedServiceFactory { ProfileOAuth2TokenServiceFactory(); virtual ~ProfileOAuth2TokenServiceFactory(); - // ProfileKeyedServiceFactory implementation. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory implementation. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenServiceFactory); diff --git a/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc b/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc index 971d66c..3cbb7ea 100644 --- a/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc +++ b/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc @@ -157,7 +157,7 @@ scoped_ptr<OAuth2TokenService::Request> return request.PassAs<OAuth2TokenService::Request>(); } -static ProfileKeyedService* CreateOAuth2TokenService( +static BrowserContextKeyedService* CreateOAuth2TokenService( content::BrowserContext* profile) { return new MockProfileOAuth2TokenService(); } diff --git a/chrome/browser/signin/signin_manager_base.h b/chrome/browser/signin/signin_manager_base.h index 967fc91..87c6be9 100644 --- a/chrome/browser/signin/signin_manager_base.h +++ b/chrome/browser/signin/signin_manager_base.h @@ -60,7 +60,7 @@ struct GoogleServiceSignoutDetails { std::string username; }; -class SigninManagerBase : public ProfileKeyedService { +class SigninManagerBase : public BrowserContextKeyedService { public: SigninManagerBase(); virtual ~SigninManagerBase(); @@ -99,7 +99,7 @@ class SigninManagerBase : public ProfileKeyedService { return signin_global_error_.get(); } - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // Methods to register or remove SigninDiagnosticObservers diff --git a/chrome/browser/signin/signin_manager_factory.cc b/chrome/browser/signin/signin_manager_factory.cc index f31bc07..f8974cf 100644 --- a/chrome/browser/signin/signin_manager_factory.cc +++ b/chrome/browser/signin/signin_manager_factory.cc @@ -15,8 +15,9 @@ #include "components/user_prefs/pref_registry_syncable.h" SigninManagerFactory::SigninManagerFactory() - : ProfileKeyedServiceFactory("SigninManager", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "SigninManager", + BrowserContextDependencyManager::GetInstance()) { DependsOn(TokenServiceFactory::GetInstance()); DependsOn(GlobalErrorServiceFactory::GetInstance()); } @@ -28,27 +29,27 @@ SigninManagerFactory::~SigninManagerFactory() {} SigninManagerBase* SigninManagerFactory::GetForProfileIfExists( Profile* profile) { return static_cast<SigninManagerBase*>( - GetInstance()->GetServiceForProfile(profile, false)); + GetInstance()->GetServiceForBrowserContext(profile, false)); } // static SigninManagerBase* SigninManagerFactory::GetForProfile( Profile* profile) { return static_cast<SigninManagerBase*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } #else // static SigninManager* SigninManagerFactory::GetForProfile(Profile* profile) { return static_cast<SigninManager*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static SigninManager* SigninManagerFactory::GetForProfileIfExists(Profile* profile) { return static_cast<SigninManager*>( - GetInstance()->GetServiceForProfile(profile, false)); + GetInstance()->GetServiceForBrowserContext(profile, false)); } #endif @@ -86,7 +87,7 @@ void SigninManagerFactory::RegisterPrefs(PrefRegistrySimple* registry) { std::string()); } -ProfileKeyedService* SigninManagerFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* SigninManagerFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { SigninManagerBase* service = NULL; Profile* profile = static_cast<Profile*>(context); diff --git a/chrome/browser/signin/signin_manager_factory.h b/chrome/browser/signin/signin_manager_factory.h index c1523cc..828ecb9 100644 --- a/chrome/browser/signin/signin_manager_factory.h +++ b/chrome/browser/signin/signin_manager_factory.h @@ -16,7 +16,7 @@ class Profile; // Singleton that owns all SigninManagers and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated SigninManager. -class SigninManagerFactory : public ProfileKeyedServiceFactory { +class SigninManagerFactory : public BrowserContextKeyedServiceFactory { public: #if defined(OS_CHROMEOS) @@ -39,7 +39,8 @@ class SigninManagerFactory : public ProfileKeyedServiceFactory { // Returns an instance of the SigninManagerFactory singleton. static SigninManagerFactory* GetInstance(); - // Implementation of ProfileKeyedServiceFactory (public so tests can call it). + // Implementation of BrowserContextKeyedServiceFactory (public so tests + // can call it). virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; @@ -52,8 +53,8 @@ class SigninManagerFactory : public ProfileKeyedServiceFactory { SigninManagerFactory(); virtual ~SigninManagerFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/signin/signin_tracker.h b/chrome/browser/signin/signin_tracker.h index 0b06b4b..5fa4af4 100644 --- a/chrome/browser/signin/signin_tracker.h +++ b/chrome/browser/signin/signin_tracker.h @@ -32,8 +32,9 @@ class Profile; // user, but the core logic lies in the base SyncSetupHandler class). // // LoginUIService - Our desktop UI flows rely on having only a single login flow -// visible to the user at once. This is achieved via LoginUIService (a -// ProfileKeyedService that keeps track of the currently visible login UI). +// visible to the user at once. This is achieved via LoginUIService +// (a BrowserContextKeyedService that keeps track of the currently visible +// login UI). // // SigninManager - Records the currently-logged-in user and handles all // interaction with the GAIA backend during the signin process. Unlike diff --git a/chrome/browser/signin/signin_tracker_unittest.cc b/chrome/browser/signin/signin_tracker_unittest.cc index 324c177..5f174a7 100644 --- a/chrome/browser/signin/signin_tracker_unittest.cc +++ b/chrome/browser/signin/signin_tracker_unittest.cc @@ -40,7 +40,8 @@ class MockTokenService : public TokenService { MOCK_CONST_METHOD1(HasTokenForService, bool(const char*)); }; -ProfileKeyedService* BuildMockTokenService(content::BrowserContext* profile) { +BrowserContextKeyedService* BuildMockTokenService( + content::BrowserContext* profile) { return new MockTokenService; } diff --git a/chrome/browser/signin/token_service.h b/chrome/browser/signin/token_service.h index af9f2f4..b8667f8 100644 --- a/chrome/browser/signin/token_service.h +++ b/chrome/browser/signin/token_service.h @@ -68,7 +68,7 @@ class URLRequestContextGetter; // The TokenService is a Profile member, so all calls are expected // from the UI thread. class TokenService : public GaiaAuthConsumer, - public ProfileKeyedService, + public BrowserContextKeyedService, public WebDataServiceConsumer { public: TokenService(); @@ -102,7 +102,7 @@ class TokenService : public GaiaAuthConsumer, GoogleServiceAuthError error_; }; - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; // Methods to register or remove SigninDiagnosticObservers diff --git a/chrome/browser/signin/token_service_factory.cc b/chrome/browser/signin/token_service_factory.cc index 1e326f5..92fb515 100644 --- a/chrome/browser/signin/token_service_factory.cc +++ b/chrome/browser/signin/token_service_factory.cc @@ -9,8 +9,9 @@ #include "components/browser_context_keyed_service/browser_context_dependency_manager.h" TokenServiceFactory::TokenServiceFactory() - : ProfileKeyedServiceFactory("TokenService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "TokenService", + BrowserContextDependencyManager::GetInstance()) { DependsOn(WebDataServiceFactory::GetInstance()); } @@ -19,7 +20,7 @@ TokenServiceFactory::~TokenServiceFactory() {} // static TokenService* TokenServiceFactory::GetForProfile(Profile* profile) { return static_cast<TokenService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -27,7 +28,7 @@ TokenServiceFactory* TokenServiceFactory::GetInstance() { return Singleton<TokenServiceFactory>::get(); } -ProfileKeyedService* TokenServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* TokenServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new TokenService(); } diff --git a/chrome/browser/signin/token_service_factory.h b/chrome/browser/signin/token_service_factory.h index 92c815ee..9346656 100644 --- a/chrome/browser/signin/token_service_factory.h +++ b/chrome/browser/signin/token_service_factory.h @@ -14,7 +14,7 @@ class Profile; // Singleton that owns all TokenServices and associates them with Profiles. // Listens for the Profile's destruction notification and cleans up the // associated TokenService. -class TokenServiceFactory : public ProfileKeyedServiceFactory { +class TokenServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the instance of TokenService associated with this profile // (creating one if none exists). Returns NULL if this profile cannot have a @@ -30,8 +30,8 @@ class TokenServiceFactory : public ProfileKeyedServiceFactory { TokenServiceFactory(); virtual ~TokenServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(TokenServiceFactory); diff --git a/chrome/browser/speech/chrome_speech_recognition_preferences.cc b/chrome/browser/speech/chrome_speech_recognition_preferences.cc index bc7cce7..d062a90 100644 --- a/chrome/browser/speech/chrome_speech_recognition_preferences.cc +++ b/chrome/browser/speech/chrome_speech_recognition_preferences.cc @@ -35,11 +35,11 @@ void ChromeSpeechRecognitionPreferences::InitializeFactory() { scoped_refptr<ChromeSpeechRecognitionPreferences> ChromeSpeechRecognitionPreferences::Factory::GetForProfile(Profile* profile) { DCHECK(profile); - // GetServiceForProfile will let us instantiate a new (if not already cached - // for the profile) Service through BuildServiceInstanceFor method. + // GetServiceForBrowserContext will let us instantiate a new (if not already + // cached for the profile) Service through BuildServiceInstanceFor method. ChromeSpeechRecognitionPreferences::Service* service = static_cast<ChromeSpeechRecognitionPreferences::Service*>( - GetServiceForProfile(profile, true)); + GetServiceForBrowserContext(profile, true)); if (!service) { // Incognito won't have this service. @@ -50,15 +50,15 @@ ChromeSpeechRecognitionPreferences::Factory::GetForProfile(Profile* profile) { } ChromeSpeechRecognitionPreferences::Factory::Factory() - : ProfileKeyedServiceFactory( + : BrowserContextKeyedServiceFactory( "ChromeSpeechRecognitionPreferences", - ProfileDependencyManager::GetInstance()) { + BrowserContextDependencyManager::GetInstance()) { } ChromeSpeechRecognitionPreferences::Factory::~Factory() { } -ProfileKeyedService* +BrowserContextKeyedService* ChromeSpeechRecognitionPreferences::Factory::BuildServiceInstanceFor( content::BrowserContext* profile) const { DCHECK(profile); @@ -84,7 +84,7 @@ ServiceIsNULLWhileTesting() const { } bool ChromeSpeechRecognitionPreferences::Factory:: -ServiceIsCreatedWithProfile() const { +ServiceIsCreatedWithBrowserContext() const { return false; } diff --git a/chrome/browser/speech/chrome_speech_recognition_preferences.h b/chrome/browser/speech/chrome_speech_recognition_preferences.h index 1a3d1a4c..cd1fc09 100644 --- a/chrome/browser/speech/chrome_speech_recognition_preferences.h +++ b/chrome/browser/speech/chrome_speech_recognition_preferences.h @@ -52,11 +52,12 @@ class ChromeSpeechRecognitionPreferences private: // The two classes below are needed to handle storage of speech recognition // preferences in profile preferences, according to the Chromium Profile - // Architecture document entitled "The New Way: ProfileKeyedServiceFactory". + // Architecture document entitled "The New Way: + // BrowserContextKeyedServiceFactory". // Singleton that manages instantiation of ChromeSpeechRecognitionPreferences // handling its association with Profiles. - class Factory : public ProfileKeyedServiceFactory { + class Factory : public BrowserContextKeyedServiceFactory { public: static Factory* GetInstance(); scoped_refptr<ChromeSpeechRecognitionPreferences> GetForProfile( @@ -68,29 +69,29 @@ class ChromeSpeechRecognitionPreferences Factory(); virtual ~Factory(); - // ProfileKeyedServiceFactory methods: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory methods: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(Factory); }; // This wrapper handles the binding between ChromeSpeechRecognitionPreferences // instances (which can have a longer lifetime, since they are refcounted) and - // ProfileKeyedService (which lifetime depends on the Profile service). Upon - // profile shutdown, the ChromeSpeechRecognitionPreferences instance is + // BrowserContextKeyedService (which lifetime depends on the Profile service). + // Upon profile shutdown, the ChromeSpeechRecognitionPreferences instance is // detached from profile, meaning that after that point its clients can still // use it, but preferences will no longer be kept in sync with the profile. - class Service : public ProfileKeyedService { + class Service : public BrowserContextKeyedService { public: explicit Service(Profile* profile); virtual ~Service(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; scoped_refptr<ChromeSpeechRecognitionPreferences> GetPreferences() const; diff --git a/chrome/browser/speech/tts_extension_loader_chromeos.cc b/chrome/browser/speech/tts_extension_loader_chromeos.cc index c454ec6..39c53cd 100644 --- a/chrome/browser/speech/tts_extension_loader_chromeos.cc +++ b/chrome/browser/speech/tts_extension_loader_chromeos.cc @@ -21,11 +21,12 @@ #include "grit/browser_resources.h" // Factory to load one instance of TtsExtensionLoaderChromeOs per profile. -class TtsExtensionLoaderChromeOsFactory : public ProfileKeyedServiceFactory { +class TtsExtensionLoaderChromeOsFactory + : public BrowserContextKeyedServiceFactory { public: static TtsExtensionLoaderChromeOs* GetForProfile(Profile* profile) { return static_cast<TtsExtensionLoaderChromeOs*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } static TtsExtensionLoaderChromeOsFactory* GetInstance() { @@ -35,9 +36,9 @@ class TtsExtensionLoaderChromeOsFactory : public ProfileKeyedServiceFactory { private: friend struct DefaultSingletonTraits<TtsExtensionLoaderChromeOsFactory>; - TtsExtensionLoaderChromeOsFactory() : ProfileKeyedServiceFactory( + TtsExtensionLoaderChromeOsFactory() : BrowserContextKeyedServiceFactory( "TtsExtensionLoaderChromeOs", - ProfileDependencyManager::GetInstance()) + BrowserContextDependencyManager::GetInstance()) {} virtual ~TtsExtensionLoaderChromeOsFactory() {} @@ -49,7 +50,7 @@ class TtsExtensionLoaderChromeOsFactory : public ProfileKeyedServiceFactory { return chrome::GetBrowserContextRedirectedInIncognito(context); } - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE { return new TtsExtensionLoaderChromeOs(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/speech/tts_extension_loader_chromeos.h b/chrome/browser/speech/tts_extension_loader_chromeos.h index b989de4..49b17d6 100644 --- a/chrome/browser/speech/tts_extension_loader_chromeos.h +++ b/chrome/browser/speech/tts_extension_loader_chromeos.h @@ -11,7 +11,7 @@ // Profile-keyed class that loads a built-in TTS component extension // into a given profile on Chrome OS. class TtsExtensionLoaderChromeOs - : public ProfileKeyedService, + : public BrowserContextKeyedService, public extensions::EventRouter::Observer { public: static TtsExtensionLoaderChromeOs* GetInstance(Profile* profile); diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc index b9b9ce4..59c6116 100644 --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc @@ -53,7 +53,7 @@ syncer::SyncDataList GetAllSyncDataNoLimit( } // namespace -static ProfileKeyedService* BuildSpellcheckService( +static BrowserContextKeyedService* BuildSpellcheckService( content::BrowserContext* profile) { return new SpellcheckService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc index c222b54..0e6bd19 100644 --- a/chrome/browser/spellchecker/spellcheck_factory.cc +++ b/chrome/browser/spellchecker/spellcheck_factory.cc @@ -18,7 +18,7 @@ // static SpellcheckService* SpellcheckServiceFactory::GetForProfile(Profile* profile) { return static_cast<SpellcheckService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -38,7 +38,7 @@ SpellcheckService* SpellcheckServiceFactory::GetForRenderProcessId( SpellcheckService* SpellcheckServiceFactory::GetForProfileWithoutCreating( Profile* profile) { return static_cast<SpellcheckService*>( - GetInstance()->GetServiceForProfile(profile, false)); + GetInstance()->GetServiceForBrowserContext(profile, false)); } // static @@ -47,15 +47,16 @@ SpellcheckServiceFactory* SpellcheckServiceFactory::GetInstance() { } SpellcheckServiceFactory::SpellcheckServiceFactory() - : ProfileKeyedServiceFactory("SpellcheckService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "SpellcheckService", + BrowserContextDependencyManager::GetInstance()) { // TODO(erg): Uncomment these as they are initialized. // DependsOn(RequestContextFactory::GetInstance()); } SpellcheckServiceFactory::~SpellcheckServiceFactory() {} -ProfileKeyedService* SpellcheckServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* SpellcheckServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); diff --git a/chrome/browser/spellchecker/spellcheck_factory.h b/chrome/browser/spellchecker/spellcheck_factory.h index 1399646..59aff27 100644 --- a/chrome/browser/spellchecker/spellcheck_factory.h +++ b/chrome/browser/spellchecker/spellcheck_factory.h @@ -15,7 +15,7 @@ class Profile; // Entry into the SpellCheck system. // // Internally, this owns all SpellcheckService objects. -class SpellcheckServiceFactory : public ProfileKeyedServiceFactory { +class SpellcheckServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the spell check host. This will create the SpellcheckService if it // does not already exist. @@ -34,8 +34,8 @@ class SpellcheckServiceFactory : public ProfileKeyedServiceFactory { SpellcheckServiceFactory(); virtual ~SpellcheckServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; diff --git a/chrome/browser/spellchecker/spellcheck_service.h b/chrome/browser/spellchecker/spellcheck_service.h index 2689708..4a4094b 100644 --- a/chrome/browser/spellchecker/spellcheck_service.h +++ b/chrome/browser/spellchecker/spellcheck_service.h @@ -32,7 +32,7 @@ class RenderProcessHost; // Encapsulates the browser side spellcheck service. There is one of these per // profile and each is created by the SpellCheckServiceFactory. The // SpellcheckService maintains any per-profile information about spellcheck. -class SpellcheckService : public ProfileKeyedService, +class SpellcheckService : public BrowserContextKeyedService, public content::NotificationObserver, public SpellcheckCustomDictionary::Observer, public SpellcheckHunspellDictionary::Observer { diff --git a/chrome/browser/spellchecker/spellcheck_service_unittest.cc b/chrome/browser/spellchecker/spellcheck_service_unittest.cc index b03bbb6..9be0fe5 100644 --- a/chrome/browser/spellchecker/spellcheck_service_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_service_unittest.cc @@ -18,7 +18,7 @@ using content::BrowserThread; using chrome::spellcheck_common::WordList; -static ProfileKeyedService* BuildSpellcheckService( +static BrowserContextKeyedService* BuildSpellcheckService( content::BrowserContext* profile) { return new SpellcheckService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.cc b/chrome/browser/sync/abstract_profile_sync_service_test.cc index 383494d..1c4a995 100644 --- a/chrome/browser/sync/abstract_profile_sync_service_test.cc +++ b/chrome/browser/sync/abstract_profile_sync_service_test.cc @@ -73,7 +73,7 @@ bool AbstractProfileSyncServiceTest::CreateRoot(ModelType model_type) { } // static -ProfileKeyedService* AbstractProfileSyncServiceTest::BuildTokenService( +BrowserContextKeyedService* AbstractProfileSyncServiceTest::BuildTokenService( content::BrowserContext* profile) { return new TokenService; } diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.h b/chrome/browser/sync/abstract_profile_sync_service_test.h index 19ba842..491e084 100644 --- a/chrome/browser/sync/abstract_profile_sync_service_test.h +++ b/chrome/browser/sync/abstract_profile_sync_service_test.h @@ -48,7 +48,7 @@ class AbstractProfileSyncServiceTest : public testing::Test { bool CreateRoot(syncer::ModelType model_type); - static ProfileKeyedService* BuildTokenService( + static BrowserContextKeyedService* BuildTokenService( content::BrowserContext* profile); protected: 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 316829a..e411c7c 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc @@ -132,7 +132,7 @@ class FakeWebDataService : public AutofillWebDataService { class MockWebDataServiceWrapperSyncable : public MockWebDataServiceWrapper { public: - static ProfileKeyedService* Build(content::BrowserContext* profile) { + static BrowserContextKeyedService* 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 2af216d..8504801 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc @@ -54,19 +54,21 @@ class HistoryMock : public HistoryService { virtual ~HistoryMock() {} }; -ProfileKeyedService* BuildBookmarkModel(content::BrowserContext* context) { +BrowserContextKeyedService* BuildBookmarkModel( + content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); BookmarkModel* bookmark_model = new BookmarkModel(profile); bookmark_model->Load(profile->GetIOTaskRunner()); return bookmark_model; } -ProfileKeyedService* BuildBookmarkModelWithoutLoading( +BrowserContextKeyedService* BuildBookmarkModelWithoutLoading( content::BrowserContext* profile) { return new BookmarkModel(static_cast<Profile*>(profile)); } -ProfileKeyedService* BuildHistoryService(content::BrowserContext* profile) { +BrowserContextKeyedService* 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 d7641c7..4dea3c7 100644 --- a/chrome/browser/sync/glue/favicon_cache.h +++ b/chrome/browser/sync/glue/favicon_cache.h @@ -53,7 +53,7 @@ class FaviconCacheObserver { }; // Encapsulates the logic for loading and storing synced favicons. -// TODO(zea): make this a ProfileKeyedService. +// TODO(zea): make this a BrowserContextKeyedService. 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 f09adfc..c6ba133 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -161,7 +161,7 @@ class ProfileSyncService : public ProfileSyncServiceBase, public SigninGlobalError::AuthStatusProvider, public syncer::UnrecoverableErrorHandler, public content::NotificationObserver, - public ProfileKeyedService, + public BrowserContextKeyedService, public invalidation::InvalidationFrontend { public: typedef browser_sync::SyncBackendHost::Status Status; @@ -617,7 +617,7 @@ class ProfileSyncService : public ProfileSyncServiceBase, virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; - // ProfileKeyedService implementation. This must be called exactly + // BrowserContextKeyedService 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 b7e3917..9bfa1a1 100644 --- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc @@ -293,7 +293,7 @@ class WebDataServiceFake : public AutofillWebDataService { DISALLOW_COPY_AND_ASSIGN(WebDataServiceFake); }; -ProfileKeyedService* BuildMockWebDataServiceWrapper( +BrowserContextKeyedService* BuildMockWebDataServiceWrapper( content::BrowserContext* profile) { return new MockWebDataServiceWrapper( new TokenWebDataServiceFake(), @@ -406,7 +406,7 @@ class MockPersonalDataManager : public PersonalDataManager { class MockPersonalDataManagerService : public autofill::PersonalDataManagerService { public: - static ProfileKeyedService* Build(content::BrowserContext* profile) { + static BrowserContextKeyedService* 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 635a119..9a5718a 100644 --- a/chrome/browser/sync/profile_sync_service_factory.cc +++ b/chrome/browser/sync/profile_sync_service_factory.cc @@ -44,12 +44,13 @@ ProfileSyncService* ProfileSyncServiceFactory::GetForProfile( return NULL; return static_cast<ProfileSyncService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } ProfileSyncServiceFactory::ProfileSyncServiceFactory() - : ProfileKeyedServiceFactory("ProfileSyncService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ProfileSyncService", + BrowserContextDependencyManager::GetInstance()) { // The ProfileSyncService depends on various SyncableServices being around // when it is shut down. Specify those dependencies here to build the proper @@ -68,10 +69,10 @@ ProfileSyncServiceFactory::ProfileSyncServiceFactory() DependsOn(BookmarkModelFactory::GetInstance()); DependsOn(AboutSigninInternalsFactory::GetInstance()); - // The following have not been converted to ProfileKeyedServices yet, and for - // now they are explicitly destroyed after the ProfileDependencyManager is - // told to DestroyProfileServices, so they will be around when the - // ProfileSyncService is destroyed. + // The following have not been converted to BrowserContextKeyedServices yet, + // and for now they are explicitly destroyed after the + // BrowserContextDependencyManager is told to DestroyBrowserContextServices, + // so they will be around when the ProfileSyncService is destroyed. // DependsOn(FaviconServiceFactory::GetInstance()); } @@ -79,7 +80,7 @@ ProfileSyncServiceFactory::ProfileSyncServiceFactory() ProfileSyncServiceFactory::~ProfileSyncServiceFactory() { } -ProfileKeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); @@ -113,5 +114,5 @@ ProfileKeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( // static bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { - return GetInstance()->GetServiceForProfile(profile, false) != NULL; + return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL; } diff --git a/chrome/browser/sync/profile_sync_service_factory.h b/chrome/browser/sync/profile_sync_service_factory.h index f632f046..0ad8c2a 100644 --- a/chrome/browser/sync/profile_sync_service_factory.h +++ b/chrome/browser/sync/profile_sync_service_factory.h @@ -12,7 +12,7 @@ class Profile; class ProfileSyncService; -class ProfileSyncServiceFactory : public ProfileKeyedServiceFactory { +class ProfileSyncServiceFactory : public BrowserContextKeyedServiceFactory { public: static ProfileSyncService* GetForProfile(Profile* profile); static bool HasProfileSyncService(Profile* profile); @@ -25,8 +25,8 @@ class ProfileSyncServiceFactory : public ProfileKeyedServiceFactory { ProfileSyncServiceFactory(); virtual ~ProfileSyncServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* 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 48f561f..b53da40 100644 --- a/chrome/browser/sync/profile_sync_service_mock.cc +++ b/chrome/browser/sync/profile_sync_service_mock.cc @@ -35,7 +35,7 @@ TestingProfile* ProfileSyncServiceMock::MakeSignedInTestingProfile() { } // static -ProfileKeyedService* ProfileSyncServiceMock::BuildMockProfileSyncService( +BrowserContextKeyedService* 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 1d6a682..ec96733 100644 --- a/chrome/browser/sync/profile_sync_service_mock.h +++ b/chrome/browser/sync/profile_sync_service_mock.h @@ -30,8 +30,8 @@ class ProfileSyncServiceMock : public ProfileSyncService { static TestingProfile* MakeSignedInTestingProfile(); // Helper routine to be used in conjunction with - // ProfileKeyedServiceFactory::SetTestingFactory(). - static ProfileKeyedService* BuildMockProfileSyncService( + // BrowserContextKeyedServiceFactory::SetTestingFactory(). + static BrowserContextKeyedService* BuildMockProfileSyncService( content::BrowserContext* profile); MOCK_METHOD0(DisableForUser, void()); diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc index d066413..fa0e680 100644 --- a/chrome/browser/sync/profile_sync_service_password_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc @@ -85,9 +85,9 @@ class NullPasswordStore : public MockPasswordStore { public: NullPasswordStore() {} - static scoped_refptr<RefcountedProfileKeyedService> Build( + static scoped_refptr<RefcountedBrowserContextKeyedService> Build( content::BrowserContext* profile) { - return scoped_refptr<RefcountedProfileKeyedService>(); + return scoped_refptr<RefcountedBrowserContextKeyedService>(); } protected: @@ -129,7 +129,7 @@ class PasswordTestProfileSyncService : public TestProfileSyncService { QuitMessageLoop(); } - static ProfileKeyedService* Build(content::BrowserContext* context) { + static BrowserContextKeyedService* Build(content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile); diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc index 12601b2..b2fc564 100644 --- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc @@ -105,7 +105,8 @@ class ProfileSyncServiceStartupTest : public testing::Test { ui_loop_.RunUntilIdle(); } - static ProfileKeyedService* BuildService(content::BrowserContext* profile) { + static BrowserContextKeyedService* BuildService( + content::BrowserContext* profile) { return new TestProfileSyncService( new ProfileSyncComponentsFactoryMock(), static_cast<Profile*>(profile), @@ -152,7 +153,7 @@ class ProfileSyncServiceStartupCrosTest : public ProfileSyncServiceStartupTest { sync_->set_synchronous_sync_configuration(); } - static ProfileKeyedService* BuildCrosService( + static BrowserContextKeyedService* BuildCrosService( content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); SigninManagerBase* signin = @@ -170,7 +171,8 @@ class ProfileSyncServiceStartupCrosTest : public ProfileSyncServiceStartupTest { } }; -ProfileKeyedService* BuildFakeTokenService(content::BrowserContext* profile) { +BrowserContextKeyedService* BuildFakeTokenService( + content::BrowserContext* profile) { return new FakeTokenService(); } 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 d84c5b5..0dd8d0f 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -101,7 +101,8 @@ class HistoryServiceMock : public HistoryService { virtual ~HistoryServiceMock() {} }; -ProfileKeyedService* BuildHistoryService(content::BrowserContext* profile) { +BrowserContextKeyedService* 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 0b613cd..d5306fc 100644 --- a/chrome/browser/sync/sync_global_error_unittest.cc +++ b/chrome/browser/sync/sync_global_error_unittest.cc @@ -62,7 +62,8 @@ class FakeLoginUI : public LoginUIService::LoginUI { int focus_ui_call_count_; }; -ProfileKeyedService* BuildMockLoginUIService(content::BrowserContext* profile) { +BrowserContextKeyedService* BuildMockLoginUIService( + content::BrowserContext* profile) { return new FakeLoginUIService(); } diff --git a/chrome/browser/sync/test/integration/search_engines_helper.cc b/chrome/browser/sync/test/integration/search_engines_helper.cc index f84c3b1..c233988 100644 --- a/chrome/browser/sync/test/integration/search_engines_helper.cc +++ b/chrome/browser/sync/test/integration/search_engines_helper.cc @@ -61,9 +61,9 @@ bool TURLsMatch(const TemplateURL* turl1, const TemplateURL* turl2) { bool ServicesMatch(int profile_a, int profile_b) { TemplateURLService* service_a = - search_engines_helper::GetServiceForProfile(profile_a); + search_engines_helper::GetServiceForBrowserContext(profile_a); TemplateURLService* service_b = - search_engines_helper::GetServiceForProfile(profile_b); + search_engines_helper::GetServiceForBrowserContext(profile_b); CHECK(service_a); CHECK(service_b); @@ -115,7 +115,7 @@ string16 CreateKeyword(int seed) { namespace search_engines_helper { -TemplateURLService* GetServiceForProfile(int profile_index) { +TemplateURLService* GetServiceForBrowserContext(int profile_index) { return TemplateURLServiceFactory::GetForProfile( test()->GetProfile(profile_index)); } @@ -126,7 +126,7 @@ TemplateURLService* GetVerifierService() { bool ServiceMatchesVerifier(int profile_index) { TemplateURLService* verifier = GetVerifierService(); - TemplateURLService* other = GetServiceForProfile(profile_index); + TemplateURLService* other = GetServiceForBrowserContext(profile_index); CHECK(verifier); CHECK(other); @@ -220,7 +220,7 @@ void EditSearchEngine(int profile_index, const string16& new_keyword, const std::string& url) { DCHECK(!url.empty()); - TemplateURLService* service = GetServiceForProfile(profile_index); + TemplateURLService* service = GetServiceForBrowserContext(profile_index); TemplateURL* turl = service->GetTemplateURLForKeyword(keyword); EXPECT_TRUE(turl); ASSERT_FALSE(new_keyword.empty()); @@ -236,7 +236,7 @@ void EditSearchEngine(int profile_index, } void DeleteSearchEngineBySeed(int profile_index, int seed) { - TemplateURLService* service = GetServiceForProfile(profile_index); + TemplateURLService* service = GetServiceForBrowserContext(profile_index); string16 keyword(CreateKeyword(seed)); TemplateURL* turl = service->GetTemplateURLForKeyword(keyword); EXPECT_TRUE(turl); @@ -251,7 +251,7 @@ void DeleteSearchEngineBySeed(int profile_index, int seed) { } void ChangeDefaultSearchProvider(int profile_index, int seed) { - TemplateURLService* service = GetServiceForProfile(profile_index); + TemplateURLService* service = GetServiceForBrowserContext(profile_index); ASSERT_TRUE(service); TemplateURL* turl = service->GetTemplateURLForKeyword(CreateKeyword(seed)); ASSERT_TRUE(turl); diff --git a/chrome/browser/sync/test/integration/search_engines_helper.h b/chrome/browser/sync/test/integration/search_engines_helper.h index 59ca00b..ff52bae 100644 --- a/chrome/browser/sync/test/integration/search_engines_helper.h +++ b/chrome/browser/sync/test/integration/search_engines_helper.h @@ -19,7 +19,7 @@ typedef std::map<std::string, const TemplateURL*> GUIDToTURLMap; namespace search_engines_helper { // Used to access the search engines within a particular sync profile. -TemplateURLService* GetServiceForProfile(int profile_index); +TemplateURLService* GetServiceForBrowserContext(int profile_index); // Used to access the search engines within the verifier sync profile. TemplateURLService* GetVerifierService(); diff --git a/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc b/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc index 9251fcc..4165d51 100644 --- a/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc @@ -145,7 +145,8 @@ IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, ConflictKeyword) { // conflict. search_engines_helper::AddSearchEngine(0, 0); search_engines_helper::AddSearchEngine(1, 1); - TemplateURLService* service = search_engines_helper::GetServiceForProfile(1); + TemplateURLService* service = + search_engines_helper::GetServiceForBrowserContext(1); TemplateURL* turl = service->GetTemplateURLForKeyword(ASCIIToUTF16("test1")); EXPECT_TRUE(turl); service->ResetTemplateURL(turl, turl->short_name(), ASCIIToUTF16("test0"), diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc index e335800..73415c06 100644 --- a/chrome/browser/sync/test_profile_sync_service.cc +++ b/chrome/browser/sync/test_profile_sync_service.cc @@ -230,7 +230,7 @@ TestProfileSyncService::~TestProfileSyncService() { } // static -ProfileKeyedService* TestProfileSyncService::BuildAutoStartAsyncInit( +BrowserContextKeyedService* TestProfileSyncService::BuildAutoStartAsyncInit( 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 5d4000f..cb9e46f 100644 --- a/chrome/browser/sync/test_profile_sync_service.h +++ b/chrome/browser/sync/test_profile_sync_service.h @@ -133,7 +133,7 @@ class TestProfileSyncService : public ProfileSyncService { // We implement our own version to avoid some DCHECKs. virtual syncer::UserShare* GetUserShare() const OVERRIDE; - static ProfileKeyedService* BuildAutoStartAsyncInit( + static BrowserContextKeyedService* BuildAutoStartAsyncInit( content::BrowserContext* profile); ProfileSyncComponentsFactoryMock* components_factory_mock(); diff --git a/chrome/browser/sync_file_system/sync_file_system_service.h b/chrome/browser/sync_file_system/sync_file_system_service.h index b051490..7403b81 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service.h +++ b/chrome/browser/sync_file_system/sync_file_system_service.h @@ -37,7 +37,7 @@ namespace sync_file_system { class SyncEventObserver; class SyncFileSystemService - : public ProfileKeyedService, + : public BrowserContextKeyedService, public ProfileSyncServiceObserver, public LocalFileSyncService::Observer, public RemoteFileSyncService::Observer, @@ -45,7 +45,7 @@ class SyncFileSystemService public content::NotificationObserver, public base::SupportsWeakPtr<SyncFileSystemService> { public: - // ProfileKeyedService overrides. + // BrowserContextKeyedService overrides. virtual void Shutdown() OVERRIDE; void InitializeForApp( diff --git a/chrome/browser/sync_file_system/sync_file_system_service_factory.cc b/chrome/browser/sync_file_system/sync_file_system_service_factory.cc index d13cfc8..f33fd18 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service_factory.cc +++ b/chrome/browser/sync_file_system/sync_file_system_service_factory.cc @@ -23,7 +23,7 @@ const char kDisableLastWriteWin[] = "disable-syncfs-last-write-win"; SyncFileSystemService* SyncFileSystemServiceFactory::GetForProfile( Profile* profile) { return static_cast<SyncFileSystemService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -37,14 +37,16 @@ void SyncFileSystemServiceFactory::set_mock_remote_file_service( } SyncFileSystemServiceFactory::SyncFileSystemServiceFactory() - : ProfileKeyedServiceFactory("SyncFileSystemService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "SyncFileSystemService", + BrowserContextDependencyManager::GetInstance()) { DependsOn(google_apis::DriveNotificationManagerFactory::GetInstance()); } SyncFileSystemServiceFactory::~SyncFileSystemServiceFactory() {} -ProfileKeyedService* SyncFileSystemServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* +SyncFileSystemServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); diff --git a/chrome/browser/sync_file_system/sync_file_system_service_factory.h b/chrome/browser/sync_file_system/sync_file_system_service_factory.h index 69ea9d0..61893dd 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service_factory.h +++ b/chrome/browser/sync_file_system/sync_file_system_service_factory.h @@ -17,7 +17,7 @@ namespace sync_file_system { class RemoteFileSyncService; class SyncFileSystemService; -class SyncFileSystemServiceFactory : public ProfileKeyedServiceFactory { +class SyncFileSystemServiceFactory : public BrowserContextKeyedServiceFactory { public: static SyncFileSystemService* GetForProfile(Profile* profile); static SyncFileSystemService* FindForProfile(Profile* profile); @@ -36,8 +36,8 @@ class SyncFileSystemServiceFactory : public ProfileKeyedServiceFactory { SyncFileSystemServiceFactory(); virtual ~SyncFileSystemServiceFactory(); - // ProfileKeyedServiceFactory overrides. - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory overrides. + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; mutable scoped_ptr<RemoteFileSyncService> mock_remote_file_service_; diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h index 96d4ea3..48f320d2 100644 --- a/chrome/browser/themes/theme_service.h +++ b/chrome/browser/themes/theme_service.h @@ -53,7 +53,7 @@ extern "C" NSString* const kBrowserThemeDidChangeNotification; class ThemeService : public base::NonThreadSafe, public content::NotificationObserver, - public ProfileKeyedService, + public BrowserContextKeyedService, public ui::ThemeProvider { public: // Public constants used in ThemeService and its subclasses: diff --git a/chrome/browser/themes/theme_service_factory.cc b/chrome/browser/themes/theme_service_factory.cc index 3a7e8ec..054d56c 100644 --- a/chrome/browser/themes/theme_service_factory.cc +++ b/chrome/browser/themes/theme_service_factory.cc @@ -21,7 +21,7 @@ // static ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) { return static_cast<ThemeService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -40,12 +40,13 @@ ThemeServiceFactory* ThemeServiceFactory::GetInstance() { } ThemeServiceFactory::ThemeServiceFactory() - : ProfileKeyedServiceFactory("ThemeService", - ProfileDependencyManager::GetInstance()) {} + : BrowserContextKeyedServiceFactory( + "ThemeService", + BrowserContextDependencyManager::GetInstance()) {} ThemeServiceFactory::~ThemeServiceFactory() {} -ProfileKeyedService* ThemeServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* ThemeServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { ThemeService* provider = NULL; #if defined(TOOLKIT_GTK) @@ -93,6 +94,6 @@ content::BrowserContext* ThemeServiceFactory::GetBrowserContextToUse( return chrome::GetBrowserContextRedirectedInIncognito(context); } -bool ThemeServiceFactory::ServiceIsCreatedWithProfile() const { +bool ThemeServiceFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/themes/theme_service_factory.h b/chrome/browser/themes/theme_service_factory.h index e786ef9..a61abc7 100644 --- a/chrome/browser/themes/theme_service_factory.h +++ b/chrome/browser/themes/theme_service_factory.h @@ -19,7 +19,7 @@ class Extension; // Singleton that owns all ThemeServices and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated ThemeService. -class ThemeServiceFactory : public ProfileKeyedServiceFactory { +class ThemeServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the ThemeService that provides theming resources for // |profile|. Note that even if a Profile doesn't have a theme installed, it @@ -39,14 +39,14 @@ class ThemeServiceFactory : public ProfileKeyedServiceFactory { ThemeServiceFactory(); virtual ~ThemeServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ThemeServiceFactory); }; diff --git a/chrome/browser/themes/theme_syncable_service_unittest.cc b/chrome/browser/themes/theme_syncable_service_unittest.cc index bb845d8..c445a23 100644 --- a/chrome/browser/themes/theme_syncable_service_unittest.cc +++ b/chrome/browser/themes/theme_syncable_service_unittest.cc @@ -132,7 +132,8 @@ class FakeThemeService : public ThemeService { bool is_dirty_; }; -ProfileKeyedService* BuildMockThemeService(content::BrowserContext* profile) { +BrowserContextKeyedService* BuildMockThemeService( + content::BrowserContext* profile) { return new FakeThemeService; } diff --git a/chrome/browser/thumbnails/thumbnail_service.h b/chrome/browser/thumbnails/thumbnail_service.h index 6c0eacf..9c7e395 100644 --- a/chrome/browser/thumbnails/thumbnail_service.h +++ b/chrome/browser/thumbnails/thumbnail_service.h @@ -22,7 +22,7 @@ struct ThumbnailingContext; // An interface abstracting access to thumbnails. Intended as a temporary // bridge facilitating switch from TopSites as the thumbnail source to a more // robust way of handling these artefacts. -class ThumbnailService : public RefcountedProfileKeyedService { +class ThumbnailService : public RefcountedBrowserContextKeyedService { public: // Sets the given thumbnail for the given URL. Returns true if the thumbnail // was updated. False means either the URL wasn't known to us, or we felt diff --git a/chrome/browser/thumbnails/thumbnail_service_factory.cc b/chrome/browser/thumbnails/thumbnail_service_factory.cc index 9a2592e..8c7de72 100644 --- a/chrome/browser/thumbnails/thumbnail_service_factory.cc +++ b/chrome/browser/thumbnails/thumbnail_service_factory.cc @@ -13,9 +13,9 @@ using thumbnails::ThumbnailService; using thumbnails::ThumbnailServiceImpl; ThumbnailServiceFactory::ThumbnailServiceFactory() - : RefcountedProfileKeyedServiceFactory( + : RefcountedBrowserContextKeyedServiceFactory( "ThumbnailService", - ProfileDependencyManager::GetInstance()) { + BrowserContextDependencyManager::GetInstance()) { } ThumbnailServiceFactory::~ThumbnailServiceFactory() { @@ -25,7 +25,7 @@ ThumbnailServiceFactory::~ThumbnailServiceFactory() { scoped_refptr<ThumbnailService> ThumbnailServiceFactory::GetForProfile( Profile* profile) { return static_cast<ThumbnailService*>( - GetInstance()->GetServiceForProfile(profile, true).get()); + GetInstance()->GetServiceForBrowserContext(profile, true).get()); } // static @@ -33,9 +33,9 @@ ThumbnailServiceFactory* ThumbnailServiceFactory::GetInstance() { return Singleton<ThumbnailServiceFactory>::get(); } -scoped_refptr<RefcountedProfileKeyedService> +scoped_refptr<RefcountedBrowserContextKeyedService> ThumbnailServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { - return scoped_refptr<RefcountedProfileKeyedService>( + return scoped_refptr<RefcountedBrowserContextKeyedService>( new ThumbnailServiceImpl(static_cast<Profile*>(profile))); } diff --git a/chrome/browser/thumbnails/thumbnail_service_factory.h b/chrome/browser/thumbnails/thumbnail_service_factory.h index 655cfa6..6249ef1 100644 --- a/chrome/browser/thumbnails/thumbnail_service_factory.h +++ b/chrome/browser/thumbnails/thumbnail_service_factory.h @@ -15,14 +15,16 @@ namespace thumbnails { class ThumbnailService; } -class ThumbnailServiceFactory : public RefcountedProfileKeyedServiceFactory { +class ThumbnailServiceFactory + : public RefcountedBrowserContextKeyedServiceFactory { public: // Returns an instance of ThumbnailService associated with this profile // (creating one if none exists). Returns NULL if this profile cannot have a // ThumbnailService (for example, if |profile| is incognito). // Depending on the settings, the implementation of the service interface // can be provided either by TopSites (stored in the profile itself) or - // be an instance of a real RefcountedProfileKeyedService implementation. + // be an instance of a real RefcountedBrowserContextKeyedService + // implementation. static scoped_refptr<thumbnails::ThumbnailService> GetForProfile( Profile* profile); @@ -34,9 +36,9 @@ class ThumbnailServiceFactory : public RefcountedProfileKeyedServiceFactory { ThumbnailServiceFactory(); virtual ~ThumbnailServiceFactory(); - // ProfileKeyedServiceFactory: - virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - content::BrowserContext* profile) const OVERRIDE; + // BrowserContextKeyedServiceFactory: + virtual scoped_refptr<RefcountedBrowserContextKeyedService> + BuildServiceInstanceFor(content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ThumbnailServiceFactory); }; diff --git a/chrome/browser/thumbnails/thumbnail_service_impl.h b/chrome/browser/thumbnails/thumbnail_service_impl.h index 0205aac..7d01d00 100644 --- a/chrome/browser/thumbnails/thumbnail_service_impl.h +++ b/chrome/browser/thumbnails/thumbnail_service_impl.h @@ -31,7 +31,7 @@ class ThumbnailServiceImpl : public ThumbnailService { scoped_refptr<base::RefCountedMemory>* bytes) OVERRIDE; virtual bool ShouldAcquirePageThumbnail(const GURL& url) OVERRIDE; - // Implementation of RefcountedProfileKeyedService. + // Implementation of RefcountedBrowserContextKeyedService. virtual void ShutdownOnUIThread() OVERRIDE; private: diff --git a/chrome/browser/ui/ash/app_sync_ui_state.h b/chrome/browser/ui/ash/app_sync_ui_state.h index e138c91..adad96a 100644 --- a/chrome/browser/ui/ash/app_sync_ui_state.h +++ b/chrome/browser/ui/ash/app_sync_ui_state.h @@ -22,7 +22,7 @@ class ProfileSyncService; // accordingly. Its status is for UI display only. It only watches for new // normal user profile (i.e. it does not watch for guest profile or exsiting // user profile) and lasts for at the most 1 minute. -class AppSyncUIState : public ProfileKeyedService, +class AppSyncUIState : public BrowserContextKeyedService, public content::NotificationObserver, public ProfileSyncServiceObserver { public: diff --git a/chrome/browser/ui/ash/app_sync_ui_state_factory.cc b/chrome/browser/ui/ash/app_sync_ui_state_factory.cc index 01ad273..edceaf0 100644 --- a/chrome/browser/ui/ash/app_sync_ui_state_factory.cc +++ b/chrome/browser/ui/ash/app_sync_ui_state_factory.cc @@ -15,7 +15,7 @@ AppSyncUIState* AppSyncUIStateFactory::GetForProfile(Profile* profile) { return NULL; return static_cast<AppSyncUIState*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -24,15 +24,16 @@ AppSyncUIStateFactory* AppSyncUIStateFactory::GetInstance() { } AppSyncUIStateFactory::AppSyncUIStateFactory() - : ProfileKeyedServiceFactory("AppSyncUIState", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "AppSyncUIState", + BrowserContextDependencyManager::GetInstance()) { DependsOn(ProfileSyncServiceFactory::GetInstance()); } AppSyncUIStateFactory::~AppSyncUIStateFactory() { } -ProfileKeyedService* AppSyncUIStateFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* AppSyncUIStateFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); DCHECK(AppSyncUIState::ShouldObserveAppSyncForProfile(profile)); diff --git a/chrome/browser/ui/ash/app_sync_ui_state_factory.h b/chrome/browser/ui/ash/app_sync_ui_state_factory.h index bcadd93..2278f10 100644 --- a/chrome/browser/ui/ash/app_sync_ui_state_factory.h +++ b/chrome/browser/ui/ash/app_sync_ui_state_factory.h @@ -14,7 +14,7 @@ class AppSyncUIState; class Profile; // Singleton that owns all AppSyncUIStates and associates them with profiles. -class AppSyncUIStateFactory : public ProfileKeyedServiceFactory { +class AppSyncUIStateFactory : public BrowserContextKeyedServiceFactory { public: static AppSyncUIState* GetForProfile(Profile* profile); @@ -26,8 +26,8 @@ class AppSyncUIStateFactory : public ProfileKeyedServiceFactory { AppSyncUIStateFactory(); virtual ~AppSyncUIStateFactory(); - // ProfileKeyedServiceFactory overrides: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory overrides: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(AppSyncUIStateFactory); diff --git a/chrome/browser/ui/bookmarks/bookmark_unittest.cc b/chrome/browser/ui/bookmarks/bookmark_unittest.cc index 84aa632..e8ccb5c 100644 --- a/chrome/browser/ui/bookmarks/bookmark_unittest.cc +++ b/chrome/browser/ui/bookmarks/bookmark_unittest.cc @@ -56,7 +56,7 @@ class BookmarkInstantExtendedTest : public BrowserWithTestWindowTest { } private: - static ProfileKeyedService* CreateTemplateURLService( + static BrowserContextKeyedService* CreateTemplateURLService( content::BrowserContext* profile) { return new TemplateURLService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/ui/find_bar/find_bar_state.h b/chrome/browser/ui/find_bar/find_bar_state.h index 7ed5678..8b13077 100644 --- a/chrome/browser/ui/find_bar/find_bar_state.h +++ b/chrome/browser/ui/find_bar/find_bar_state.h @@ -14,7 +14,7 @@ class Profile; -class FindBarState : public ProfileKeyedService { +class FindBarState : public BrowserContextKeyedService { public: FindBarState() {} virtual ~FindBarState() {} diff --git a/chrome/browser/ui/find_bar/find_bar_state_factory.cc b/chrome/browser/ui/find_bar/find_bar_state_factory.cc index a29aebc..bfd1a48 100644 --- a/chrome/browser/ui/find_bar/find_bar_state_factory.cc +++ b/chrome/browser/ui/find_bar/find_bar_state_factory.cc @@ -12,7 +12,7 @@ // static FindBarState* FindBarStateFactory::GetForProfile(Profile* profile) { return static_cast<FindBarState*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -35,13 +35,14 @@ FindBarStateFactory* FindBarStateFactory::GetInstance() { } FindBarStateFactory::FindBarStateFactory() - : ProfileKeyedServiceFactory("FindBarState", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "FindBarState", + BrowserContextDependencyManager::GetInstance()) { } FindBarStateFactory::~FindBarStateFactory() {} -ProfileKeyedService* FindBarStateFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* FindBarStateFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new FindBarState; } diff --git a/chrome/browser/ui/find_bar/find_bar_state_factory.h b/chrome/browser/ui/find_bar/find_bar_state_factory.h index cee7411..88c6cfe 100644 --- a/chrome/browser/ui/find_bar/find_bar_state_factory.h +++ b/chrome/browser/ui/find_bar/find_bar_state_factory.h @@ -13,7 +13,7 @@ class Profile; class FindBarState; -class FindBarStateFactory : public ProfileKeyedServiceFactory { +class FindBarStateFactory : public BrowserContextKeyedServiceFactory { public: static FindBarState* GetForProfile(Profile* profile); @@ -30,8 +30,8 @@ class FindBarStateFactory : public ProfileKeyedServiceFactory { FindBarStateFactory(); virtual ~FindBarStateFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc b/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc index 09f810c..288af95 100644 --- a/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc +++ b/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc @@ -119,12 +119,12 @@ const std::vector<WorkspaceCyclerPref>& GetWorkspaceCyclerPrefs() { #endif // USE_ASH // This class manages gesture configuration preferences. -class GesturePrefsObserver : public ProfileKeyedService { +class GesturePrefsObserver : public BrowserContextKeyedService { public: explicit GesturePrefsObserver(PrefService* prefs); virtual ~GesturePrefsObserver(); - // ProfileKeyedService implementation. + // BrowserContextKeyedService implementation. virtual void Shutdown() OVERRIDE; private: @@ -371,12 +371,14 @@ GesturePrefsObserverFactoryAura::GetInstance() { } GesturePrefsObserverFactoryAura::GesturePrefsObserverFactoryAura() - : ProfileKeyedServiceFactory("GesturePrefsObserverAura", - ProfileDependencyManager::GetInstance()) {} + : BrowserContextKeyedServiceFactory( + "GesturePrefsObserverAura", + BrowserContextDependencyManager::GetInstance()) {} GesturePrefsObserverFactoryAura::~GesturePrefsObserverFactoryAura() {} -ProfileKeyedService* GesturePrefsObserverFactoryAura::BuildServiceInstanceFor( +BrowserContextKeyedService* +GesturePrefsObserverFactoryAura::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new GesturePrefsObserver(static_cast<Profile*>(profile)->GetPrefs()); } @@ -571,7 +573,8 @@ void GesturePrefsObserverFactoryAura::RegisterUserPrefs( RegisterWorkspaceCyclerPrefs(registry); } -bool GesturePrefsObserverFactoryAura::ServiceIsCreatedWithProfile() const { +bool +GesturePrefsObserverFactoryAura::ServiceIsCreatedWithBrowserContext() const { // Create the observer as soon as the profile is created. return true; } diff --git a/chrome/browser/ui/gesture_prefs_observer_factory_aura.h b/chrome/browser/ui/gesture_prefs_observer_factory_aura.h index 9e8fa0f..62de59b 100644 --- a/chrome/browser/ui/gesture_prefs_observer_factory_aura.h +++ b/chrome/browser/ui/gesture_prefs_observer_factory_aura.h @@ -13,7 +13,8 @@ class PrefService; class Profile; // Create an observer per Profile that listens for gesture preferences updates. -class GesturePrefsObserverFactoryAura : public ProfileKeyedServiceFactory { +class GesturePrefsObserverFactoryAura + : public BrowserContextKeyedServiceFactory { public: static GesturePrefsObserverFactoryAura* GetInstance(); @@ -28,12 +29,12 @@ class GesturePrefsObserverFactoryAura : public ProfileKeyedServiceFactory { void RegisterImmersiveModePrefs(user_prefs::PrefRegistrySyncable* registry); void RegisterWorkspaceCyclerPrefs(user_prefs::PrefRegistrySyncable* registry); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs( user_prefs::PrefRegistrySyncable* registry) OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/ui/global_error/global_error_service.h b/chrome/browser/ui/global_error/global_error_service.h index a418877..6ceccc1 100644 --- a/chrome/browser/ui/global_error/global_error_service.h +++ b/chrome/browser/ui/global_error/global_error_service.h @@ -18,7 +18,7 @@ class Profile; // error should be shown using this service. Examples of global errors are: // - the previous session crashed for a given profile. // - a sync error occurred -class GlobalErrorService : public ProfileKeyedService { +class GlobalErrorService : public BrowserContextKeyedService { public: // Type used to represent the list of currently active errors. typedef std::vector<GlobalError*> GlobalErrorList; diff --git a/chrome/browser/ui/global_error/global_error_service_factory.cc b/chrome/browser/ui/global_error/global_error_service_factory.cc index 7c78f642..cc4be64 100644 --- a/chrome/browser/ui/global_error/global_error_service_factory.cc +++ b/chrome/browser/ui/global_error/global_error_service_factory.cc @@ -12,7 +12,7 @@ // static GlobalErrorService* GlobalErrorServiceFactory::GetForProfile(Profile* profile) { return static_cast<GlobalErrorService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -21,14 +21,15 @@ GlobalErrorServiceFactory* GlobalErrorServiceFactory::GetInstance() { } GlobalErrorServiceFactory::GlobalErrorServiceFactory() - : ProfileKeyedServiceFactory("GlobalErrorService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "GlobalErrorService", + BrowserContextDependencyManager::GetInstance()) { } GlobalErrorServiceFactory::~GlobalErrorServiceFactory() { } -ProfileKeyedService* GlobalErrorServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* GlobalErrorServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new GlobalErrorService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/ui/global_error/global_error_service_factory.h b/chrome/browser/ui/global_error/global_error_service_factory.h index 09df139..8f0c80f 100644 --- a/chrome/browser/ui/global_error/global_error_service_factory.h +++ b/chrome/browser/ui/global_error/global_error_service_factory.h @@ -16,7 +16,7 @@ class Profile; // Singleton that owns all GlobalErrorService and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated GlobalErrorService. -class GlobalErrorServiceFactory : public ProfileKeyedServiceFactory { +class GlobalErrorServiceFactory : public BrowserContextKeyedServiceFactory { public: static GlobalErrorService* GetForProfile(Profile* profile); @@ -28,8 +28,8 @@ class GlobalErrorServiceFactory : public ProfileKeyedServiceFactory { GlobalErrorServiceFactory(); virtual ~GlobalErrorServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc index 0681f46..2d1537d 100644 --- a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc +++ b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc @@ -155,8 +155,8 @@ class OneClickTestProfileSyncService : public TestProfileSyncService { virtual ~OneClickTestProfileSyncService() {} // Helper routine to be used in conjunction with - // ProfileKeyedServiceFactory::SetTestingFactory(). - static ProfileKeyedService* Build(content::BrowserContext* profile) { + // BrowserContextKeyedServiceFactory::SetTestingFactory(). + static BrowserContextKeyedService* Build(content::BrowserContext* profile) { return new OneClickTestProfileSyncService(static_cast<Profile*>(profile)); } @@ -189,7 +189,7 @@ class OneClickTestProfileSyncService : public TestProfileSyncService { bool first_setup_in_progress_; }; -static ProfileKeyedService* BuildSigninManagerMock( +static BrowserContextKeyedService* BuildSigninManagerMock( content::BrowserContext* profile) { return new SigninManagerMock(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/ui/tabs/pinned_tab_service.h b/chrome/browser/ui/tabs/pinned_tab_service.h index b093d7f..7524ebc 100644 --- a/chrome/browser/ui/tabs/pinned_tab_service.h +++ b/chrome/browser/ui/tabs/pinned_tab_service.h @@ -16,7 +16,7 @@ class Profile; // pinned tabs to restore at startup. PinnedTabService listens for the // appropriate set of notifications to know it should update preferences. class PinnedTabService : public content::NotificationObserver, - public ProfileKeyedService { + public BrowserContextKeyedService { public: explicit PinnedTabService(Profile* profile); diff --git a/chrome/browser/ui/tabs/pinned_tab_service_factory.cc b/chrome/browser/ui/tabs/pinned_tab_service_factory.cc index 4496289..2d04542 100644 --- a/chrome/browser/ui/tabs/pinned_tab_service_factory.cc +++ b/chrome/browser/ui/tabs/pinned_tab_service_factory.cc @@ -12,7 +12,7 @@ PinnedTabService* PinnedTabServiceFactory::GetForProfile( Profile* profile) { return static_cast<PinnedTabService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } PinnedTabServiceFactory* PinnedTabServiceFactory::GetInstance() { @@ -20,19 +20,20 @@ PinnedTabServiceFactory* PinnedTabServiceFactory::GetInstance() { } PinnedTabServiceFactory::PinnedTabServiceFactory() - : ProfileKeyedServiceFactory("PinnedTabService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "PinnedTabService", + BrowserContextDependencyManager::GetInstance()) { } PinnedTabServiceFactory::~PinnedTabServiceFactory() { } -ProfileKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new PinnedTabService(static_cast<Profile*>(profile)); } -bool PinnedTabServiceFactory::ServiceIsCreatedWithProfile() const { +bool PinnedTabServiceFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/chrome/browser/ui/tabs/pinned_tab_service_factory.h b/chrome/browser/ui/tabs/pinned_tab_service_factory.h index 90e937f..fe05b2d 100644 --- a/chrome/browser/ui/tabs/pinned_tab_service_factory.h +++ b/chrome/browser/ui/tabs/pinned_tab_service_factory.h @@ -15,7 +15,7 @@ class Profile; // Singleton that owns all PinnedTabServices and associates them with Profiles. // Listens for the Profile's destruction notification and cleans up the // associated PinnedTabService. -class PinnedTabServiceFactory : public ProfileKeyedServiceFactory { +class PinnedTabServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the PinnedTabService that tracks pinning changes for |profile|. static PinnedTabService* GetForProfile(Profile* profile); @@ -28,10 +28,10 @@ class PinnedTabServiceFactory : public ProfileKeyedServiceFactory { PinnedTabServiceFactory(); virtual ~PinnedTabServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/ui/tabs/pinned_tab_service_unittest.cc b/chrome/browser/ui/tabs/pinned_tab_service_unittest.cc index 9397526..8d0f6d2 100644 --- a/chrome/browser/ui/tabs/pinned_tab_service_unittest.cc +++ b/chrome/browser/ui/tabs/pinned_tab_service_unittest.cc @@ -18,7 +18,8 @@ namespace { -ProfileKeyedService* BuildPinnedTabService(content::BrowserContext* profile) { +BrowserContextKeyedService* BuildPinnedTabService( + content::BrowserContext* profile) { return new PinnedTabService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc index 1ec4506..26fd42f 100644 --- a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc +++ b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc @@ -63,7 +63,7 @@ class RecentTabsSubMenuModelTest : public BrowserWithTestWindowTest { associator_.SetCurrentMachineTagForTesting("RecentTabsSubMenuModelTest"); } - static ProfileKeyedService* GetTabRestoreService( + static BrowserContextKeyedService* GetTabRestoreService( content::BrowserContext* browser_context) { // Ownership is tranfered to the profile. return new PersistentTabRestoreService( diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc index 40d3272..bc545f7 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc @@ -50,7 +50,7 @@ class BookmarkBarViewInstantExtendedTest : public BrowserWithTestWindowTest { } private: - static ProfileKeyedService* CreateTemplateURLService( + static BrowserContextKeyedService* CreateTemplateURLService( content::BrowserContext* profile) { return new TemplateURLService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/ui/views/frame/browser_view_unittest.cc b/chrome/browser/ui/views/frame/browser_view_unittest.cc index 3a197e8..7eb5ed2 100644 --- a/chrome/browser/ui/views/frame/browser_view_unittest.cc +++ b/chrome/browser/ui/views/frame/browser_view_unittest.cc @@ -48,12 +48,12 @@ gfx::Point ExpectedTabStripOrigin(BrowserView* browser_view) { } // Caller owns the returned service. -ProfileKeyedService* CreateTemplateURLService( +BrowserContextKeyedService* CreateTemplateURLService( content::BrowserContext* profile) { return new TemplateURLService(static_cast<Profile*>(profile)); } -ProfileKeyedService* CreateAutocompleteClassifier( +BrowserContextKeyedService* CreateAutocompleteClassifier( content::BrowserContext* profile) { return new AutocompleteClassifier(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc index 7d0a1d9..6c8afb7 100644 --- a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc +++ b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc @@ -13,7 +13,7 @@ // static NTPResourceCache* AppResourceCacheFactory::GetForProfile(Profile* profile) { return static_cast<NTPResourceCache*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -22,8 +22,9 @@ AppResourceCacheFactory* AppResourceCacheFactory::GetInstance() { } AppResourceCacheFactory::AppResourceCacheFactory() - : ProfileKeyedServiceFactory("AppResourceCache", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "AppResourceCache", + BrowserContextDependencyManager::GetInstance()) { #if defined(ENABLE_THEMES) DependsOn(ThemeServiceFactory::GetInstance()); #endif @@ -31,7 +32,7 @@ AppResourceCacheFactory::AppResourceCacheFactory() AppResourceCacheFactory::~AppResourceCacheFactory() {} -ProfileKeyedService* AppResourceCacheFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* AppResourceCacheFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new NTPResourceCache(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h index 52672e4..4f1179d 100644 --- a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h +++ b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h @@ -14,7 +14,7 @@ class Profile; // Singleton that owns NTPResourceCaches used by the apps launcher page and // associates them with Profiles. Listens for the Profile's destruction // notification and cleans up the associated ThemeService. -class AppResourceCacheFactory : public ProfileKeyedServiceFactory { +class AppResourceCacheFactory : public BrowserContextKeyedServiceFactory { public: static NTPResourceCache* GetForProfile(Profile* profile); @@ -26,8 +26,8 @@ class AppResourceCacheFactory : public ProfileKeyedServiceFactory { AppResourceCacheFactory(); virtual ~AppResourceCacheFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.h b/chrome/browser/ui/webui/ntp/ntp_resource_cache.h index 8d020c0..f960bab 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.h +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.h @@ -23,7 +23,7 @@ class RefCountedMemory; // This class keeps a cache of NTP resources (HTML and CSS) so we don't have to // regenerate them all the time. class NTPResourceCache : public content::NotificationObserver, - public ProfileKeyedService { + public BrowserContextKeyedService { public: explicit NTPResourceCache(Profile* profile); virtual ~NTPResourceCache(); diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc index c1165e8..0a7025f 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc @@ -13,7 +13,7 @@ // static NTPResourceCache* NTPResourceCacheFactory::GetForProfile(Profile* profile) { return static_cast<NTPResourceCache*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -22,8 +22,9 @@ NTPResourceCacheFactory* NTPResourceCacheFactory::GetInstance() { } NTPResourceCacheFactory::NTPResourceCacheFactory() - : ProfileKeyedServiceFactory("NTPResourceCache", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "NTPResourceCache", + BrowserContextDependencyManager::GetInstance()) { #if defined(ENABLE_THEMES) DependsOn(ThemeServiceFactory::GetInstance()); #endif @@ -31,7 +32,7 @@ NTPResourceCacheFactory::NTPResourceCacheFactory() NTPResourceCacheFactory::~NTPResourceCacheFactory() {} -ProfileKeyedService* NTPResourceCacheFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* NTPResourceCacheFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new NTPResourceCache(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h index 3137f06..2be7d33 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h @@ -14,7 +14,7 @@ class Profile; // Singleton that owns the NTPResourceCaches used by the NTP and associates them // with Profiles. Listens for the Profile's destruction notification and cleans // up the associated ThemeService. -class NTPResourceCacheFactory : public ProfileKeyedServiceFactory { +class NTPResourceCacheFactory : public BrowserContextKeyedServiceFactory { public: static NTPResourceCache* GetForProfile(Profile* profile); @@ -26,8 +26,8 @@ class NTPResourceCacheFactory : public ProfileKeyedServiceFactory { NTPResourceCacheFactory(); virtual ~NTPResourceCacheFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; diff --git a/chrome/browser/ui/webui/signin/login_ui_service.h b/chrome/browser/ui/webui/signin/login_ui_service.h index b30233dd..479eba0 100644 --- a/chrome/browser/ui/webui/signin/login_ui_service.h +++ b/chrome/browser/ui/webui/signin/login_ui_service.h @@ -14,7 +14,7 @@ class Profile; // The LoginUIService helps track per-profile information for the login UI - // for example, whether there is login UI currently on-screen. -class LoginUIService : public ProfileKeyedService { +class LoginUIService : public BrowserContextKeyedService { public: // Various UI components implement this API to allow LoginUIService to // manipulate their associated login UI. diff --git a/chrome/browser/ui/webui/signin/login_ui_service_factory.cc b/chrome/browser/ui/webui/signin/login_ui_service_factory.cc index 4242a41..e502476 100644 --- a/chrome/browser/ui/webui/signin/login_ui_service_factory.cc +++ b/chrome/browser/ui/webui/signin/login_ui_service_factory.cc @@ -11,8 +11,9 @@ #include "components/browser_context_keyed_service/browser_context_dependency_manager.h" LoginUIServiceFactory::LoginUIServiceFactory() - : ProfileKeyedServiceFactory("LoginUIServiceFactory", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "LoginUIServiceFactory", + BrowserContextDependencyManager::GetInstance()) { } LoginUIServiceFactory::~LoginUIServiceFactory() {} @@ -20,7 +21,7 @@ LoginUIServiceFactory::~LoginUIServiceFactory() {} // static LoginUIService* LoginUIServiceFactory::GetForProfile(Profile* profile) { return static_cast<LoginUIService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -28,7 +29,7 @@ LoginUIServiceFactory* LoginUIServiceFactory::GetInstance() { return Singleton<LoginUIServiceFactory>::get(); } -ProfileKeyedService* LoginUIServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* LoginUIServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new LoginUIService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/ui/webui/signin/login_ui_service_factory.h b/chrome/browser/ui/webui/signin/login_ui_service_factory.h index b838d5e..ddaebf4 100644 --- a/chrome/browser/ui/webui/signin/login_ui_service_factory.h +++ b/chrome/browser/ui/webui/signin/login_ui_service_factory.h @@ -14,7 +14,7 @@ class Profile; // Singleton that owns all LoginUIServices and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated LoginUIService. -class LoginUIServiceFactory : public ProfileKeyedServiceFactory { +class LoginUIServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the instance of LoginUIService associated with this profile // (creating one if none exists). Returns NULL if this profile cannot have a @@ -30,8 +30,8 @@ class LoginUIServiceFactory : public ProfileKeyedServiceFactory { LoginUIServiceFactory(); virtual ~LoginUIServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(LoginUIServiceFactory); diff --git a/chrome/browser/usb/usb_service.h b/chrome/browser/usb/usb_service.h index 716359b..3e9d34e 100644 --- a/chrome/browser/usb/usb_service.h +++ b/chrome/browser/usb/usb_service.h @@ -22,7 +22,7 @@ typedef libusb_context* PlatformUsbContext; // used to manage and dispatch USB events. It is also responsbile for device // discovery on the system, which allows it to re-use device handles to prevent // competition for the same USB device. -class UsbService : public ProfileKeyedService { +class UsbService : public BrowserContextKeyedService { public: UsbService(); virtual ~UsbService(); diff --git a/chrome/browser/usb/usb_service_factory.cc b/chrome/browser/usb/usb_service_factory.cc index cd91233..b2622c9 100644 --- a/chrome/browser/usb/usb_service_factory.cc +++ b/chrome/browser/usb/usb_service_factory.cc @@ -15,15 +15,15 @@ UsbServiceFactory* UsbServiceFactory::GetInstance() { UsbService* UsbServiceFactory::GetForProfile(Profile* profile) { return static_cast<UsbService*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } -UsbServiceFactory::UsbServiceFactory() : ProfileKeyedServiceFactory( - "UsbService", ProfileDependencyManager::GetInstance()) {} +UsbServiceFactory::UsbServiceFactory() : BrowserContextKeyedServiceFactory( + "UsbService", BrowserContextDependencyManager::GetInstance()) {} UsbServiceFactory::~UsbServiceFactory() {} -ProfileKeyedService* UsbServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* UsbServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new UsbService(); } diff --git a/chrome/browser/usb/usb_service_factory.h b/chrome/browser/usb/usb_service_factory.h index 7a4b691..7ef21e6 100644 --- a/chrome/browser/usb/usb_service_factory.h +++ b/chrome/browser/usb/usb_service_factory.h @@ -11,7 +11,7 @@ class Profile; class UsbService; -class UsbServiceFactory : public ProfileKeyedServiceFactory { +class UsbServiceFactory : public BrowserContextKeyedServiceFactory { public: static UsbService* GetForProfile(Profile* profile); static bool HasUsbService(Profile* profile); @@ -24,7 +24,7 @@ class UsbServiceFactory : public ProfileKeyedServiceFactory { UsbServiceFactory(); virtual ~UsbServiceFactory(); - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; }; diff --git a/chrome/browser/user_style_sheet_watcher.cc b/chrome/browser/user_style_sheet_watcher.cc index 7f06e9e..dd7ab40 100644 --- a/chrome/browser/user_style_sheet_watcher.cc +++ b/chrome/browser/user_style_sheet_watcher.cc @@ -139,7 +139,7 @@ void UserStyleSheetLoader::SetStyleSheet(const GURL& url) { UserStyleSheetWatcher::UserStyleSheetWatcher(Profile* profile, const base::FilePath& profile_path) - : RefcountedProfileKeyedService(content::BrowserThread::UI), + : RefcountedBrowserContextKeyedService(content::BrowserThread::UI), profile_(profile), profile_path_(profile_path), loader_(new UserStyleSheetLoader) { diff --git a/chrome/browser/user_style_sheet_watcher.h b/chrome/browser/user_style_sheet_watcher.h index 711f188..72b002c 100644 --- a/chrome/browser/user_style_sheet_watcher.h +++ b/chrome/browser/user_style_sheet_watcher.h @@ -22,7 +22,7 @@ class UserStyleSheetLoader; // whenever the file changes. class UserStyleSheetWatcher : public content::NotificationObserver, - public RefcountedProfileKeyedService { + public RefcountedBrowserContextKeyedService { public: UserStyleSheetWatcher(Profile* profile, const base::FilePath& profile_path); diff --git a/chrome/browser/user_style_sheet_watcher_factory.cc b/chrome/browser/user_style_sheet_watcher_factory.cc index fb572fb..a69f77e 100644 --- a/chrome/browser/user_style_sheet_watcher_factory.cc +++ b/chrome/browser/user_style_sheet_watcher_factory.cc @@ -14,7 +14,7 @@ scoped_refptr<UserStyleSheetWatcher> UserStyleSheetWatcherFactory::GetForProfile( Profile* profile) { return static_cast<UserStyleSheetWatcher*>( - GetInstance()->GetServiceForProfile(profile, true).get()); + GetInstance()->GetServiceForBrowserContext(profile, true).get()); } // static @@ -23,14 +23,15 @@ UserStyleSheetWatcherFactory* UserStyleSheetWatcherFactory::GetInstance() { } UserStyleSheetWatcherFactory::UserStyleSheetWatcherFactory() - : RefcountedProfileKeyedServiceFactory( - "UserStyleSheetWatcher", ProfileDependencyManager::GetInstance()) { + : RefcountedBrowserContextKeyedServiceFactory( + "UserStyleSheetWatcher", + BrowserContextDependencyManager::GetInstance()) { } UserStyleSheetWatcherFactory::~UserStyleSheetWatcherFactory() { } -scoped_refptr<RefcountedProfileKeyedService> +scoped_refptr<RefcountedBrowserContextKeyedService> UserStyleSheetWatcherFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = static_cast<Profile*>(context); diff --git a/chrome/browser/user_style_sheet_watcher_factory.h b/chrome/browser/user_style_sheet_watcher_factory.h index e3e744a..3b0bda7 100644 --- a/chrome/browser/user_style_sheet_watcher_factory.h +++ b/chrome/browser/user_style_sheet_watcher_factory.h @@ -14,7 +14,7 @@ class UserStyleSheetWatcher; // Singleton that owns all UserStyleSheetWatcher and associates them with // Profiles. class UserStyleSheetWatcherFactory - : public RefcountedProfileKeyedServiceFactory { + : public RefcountedBrowserContextKeyedServiceFactory { public: static scoped_refptr<UserStyleSheetWatcher> GetForProfile(Profile* profile); @@ -26,9 +26,9 @@ class UserStyleSheetWatcherFactory UserStyleSheetWatcherFactory(); virtual ~UserStyleSheetWatcherFactory(); - // ProfileKeyedServiceFactory: - virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - content::BrowserContext* context) const OVERRIDE; + // BrowserContextKeyedServiceFactory: + virtual scoped_refptr<RefcountedBrowserContextKeyedService> + BuildServiceInstanceFor(content::BrowserContext* context) const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/webdata/web_data_service_factory.cc b/chrome/browser/webdata/web_data_service_factory.cc index 5af5af5..95b557b 100644 --- a/chrome/browser/webdata/web_data_service_factory.cc +++ b/chrome/browser/webdata/web_data_service_factory.cc @@ -156,8 +156,9 @@ scoped_refptr<WebDataService> WebDataService::FromBrowserContext( } WebDataServiceFactory::WebDataServiceFactory() - : ProfileKeyedServiceFactory("WebDataService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "WebDataService", + BrowserContextDependencyManager::GetInstance()) { // WebDataServiceFactory has no dependecies. } @@ -171,7 +172,7 @@ WebDataServiceWrapper* WebDataServiceFactory::GetForProfile( // AutofillWebDataService::FromBrowserContext (see above). DCHECK(access_type != Profile::IMPLICIT_ACCESS || !profile->IsOffTheRecord()); return static_cast<WebDataServiceWrapper*>( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static @@ -182,7 +183,7 @@ WebDataServiceWrapper* WebDataServiceFactory::GetForProfileIfExists( // AutofillWebDataService::FromBrowserContext (see above). DCHECK(access_type != Profile::IMPLICIT_ACCESS || !profile->IsOffTheRecord()); return static_cast<WebDataServiceWrapper*>( - GetInstance()->GetServiceForProfile(profile, false)); + GetInstance()->GetServiceForBrowserContext(profile, false)); } // static @@ -195,7 +196,7 @@ content::BrowserContext* WebDataServiceFactory::GetBrowserContextToUse( return chrome::GetBrowserContextRedirectedInIncognito(context); } -ProfileKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new WebDataServiceWrapper(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/webdata/web_data_service_factory.h b/chrome/browser/webdata/web_data_service_factory.h index 5d3d4a9..504e982 100644 --- a/chrome/browser/webdata/web_data_service_factory.h +++ b/chrome/browser/webdata/web_data_service_factory.h @@ -20,7 +20,7 @@ class AutofillWebDataService; } // namespace autofill // A wrapper of WebDataService so that we can use it as a profile keyed service. -class WebDataServiceWrapper : public ProfileKeyedService { +class WebDataServiceWrapper : public BrowserContextKeyedService { public: explicit WebDataServiceWrapper(Profile* profile); @@ -29,7 +29,7 @@ class WebDataServiceWrapper : public ProfileKeyedService { virtual ~WebDataServiceWrapper(); - // ProfileKeyedService: + // BrowserContextKeyedService: virtual void Shutdown() OVERRIDE; virtual scoped_refptr<autofill::AutofillWebDataService> GetAutofillWebData(); @@ -47,7 +47,7 @@ class WebDataServiceWrapper : public ProfileKeyedService { // Singleton that owns all WebDataServiceWrappers and associates them with // Profiles. -class WebDataServiceFactory : public ProfileKeyedServiceFactory { +class WebDataServiceFactory : public BrowserContextKeyedServiceFactory { public: // Returns the |WebDataServiceWrapper| associated with the |profile|. // |access_type| is either EXPLICIT_ACCESS or IMPLICIT_ACCESS @@ -66,10 +66,10 @@ class WebDataServiceFactory : public ProfileKeyedServiceFactory { WebDataServiceFactory(); virtual ~WebDataServiceFactory(); - // |ProfileKeyedBaseFactory| methods: + // |BrowserContextKeyedBaseFactory| methods: virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const OVERRIDE; - virtual ProfileKeyedService* BuildServiceInstanceFor( + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/test/base/chrome_render_view_host_test_harness.cc b/chrome/test/base/chrome_render_view_host_test_harness.cc index e595ebd..62e39f7 100644 --- a/chrome/test/base/chrome_render_view_host_test_harness.cc +++ b/chrome/test/base/chrome_render_view_host_test_harness.cc @@ -36,7 +36,7 @@ RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() { return RenderViewHostTester::For(rvh()); } -static ProfileKeyedService* BuildSigninManagerFake( +static BrowserContextKeyedService* BuildSigninManagerFake( content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); #if defined (OS_CHROMEOS) diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index 0c51fe9..f2dac8b 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -146,7 +146,7 @@ class TestExtensionURLRequestContextGetter scoped_ptr<net::URLRequestContext> context_; }; -ProfileKeyedService* CreateTestDesktopNotificationService( +BrowserContextKeyedService* CreateTestDesktopNotificationService( content::BrowserContext* profile) { #if defined(ENABLE_NOTIFICATIONS) return new DesktopNotificationService(static_cast<Profile*>(profile), NULL); @@ -172,7 +172,8 @@ TestingProfile::TestingProfile() incognito_(false), original_profile_(NULL), last_session_exited_cleanly_(true), - profile_dependency_manager_(ProfileDependencyManager::GetInstance()), + profile_dependency_manager_( + BrowserContextDependencyManager::GetInstance()), delegate_(NULL) { CreateTempProfileDir(); profile_path_ = temp_dir_.path(); @@ -188,7 +189,8 @@ TestingProfile::TestingProfile(const base::FilePath& path) original_profile_(NULL), last_session_exited_cleanly_(true), profile_path_(path), - profile_dependency_manager_(ProfileDependencyManager::GetInstance()), + profile_dependency_manager_( + BrowserContextDependencyManager::GetInstance()), delegate_(NULL) { Init(); FinishInit(); @@ -202,7 +204,8 @@ TestingProfile::TestingProfile(const base::FilePath& path, original_profile_(NULL), last_session_exited_cleanly_(true), profile_path_(path), - profile_dependency_manager_(ProfileDependencyManager::GetInstance()), + profile_dependency_manager_( + BrowserContextDependencyManager::GetInstance()), delegate_(delegate) { Init(); if (delegate_) { @@ -227,7 +230,8 @@ TestingProfile::TestingProfile( last_session_exited_cleanly_(true), extension_special_storage_policy_(extension_policy), profile_path_(path), - profile_dependency_manager_(ProfileDependencyManager::GetInstance()), + profile_dependency_manager_( + BrowserContextDependencyManager::GetInstance()), delegate_(delegate) { // If no profile path was supplied, create one. @@ -281,7 +285,7 @@ void TestingProfile::Init() { // Normally this would happen during browser startup, but for tests // we need to trigger creation of Profile-related services. ChromeBrowserMainExtraPartsProfiles:: - EnsureProfileKeyedServiceFactoriesBuilt(); + EnsureBrowserContextKeyedServiceFactoriesBuilt(); if (prefs_.get()) components::UserPrefs::Set(this, prefs_.get()); @@ -299,7 +303,7 @@ void TestingProfile::Init() { extensions::ExtensionSystemFactory::GetInstance()->SetTestingFactory( this, extensions::TestExtensionSystem::Build); - profile_dependency_manager_->CreateProfileServices(this, true); + profile_dependency_manager_->CreateBrowserContextServices(this, true); #if defined(ENABLE_NOTIFICATIONS) // Install profile keyed service factory hooks for dummy/test services @@ -322,7 +326,7 @@ void TestingProfile::FinishInit() { TestingProfile::~TestingProfile() { MaybeSendDestroyedNotification(); - profile_dependency_manager_->DestroyProfileServices(this); + profile_dependency_manager_->DestroyBrowserContextServices(this); if (host_content_settings_map_) host_content_settings_map_->ShutdownOnUIThread(); @@ -333,7 +337,7 @@ TestingProfile::~TestingProfile() { pref_proxy_config_tracker_->DetachFromPrefService(); } -static ProfileKeyedService* BuildFaviconService( +static BrowserContextKeyedService* BuildFaviconService( content::BrowserContext* profile) { return new FaviconService( HistoryServiceFactory::GetForProfileWithoutCreating( @@ -346,7 +350,7 @@ void TestingProfile::CreateFaviconService() { this, BuildFaviconService); } -static ProfileKeyedService* BuildHistoryService( +static BrowserContextKeyedService* BuildHistoryService( content::BrowserContext* profile) { return new HistoryService(static_cast<Profile*>(profile)); } @@ -413,7 +417,7 @@ void TestingProfile::DestroyTopSites() { } } -static ProfileKeyedService* BuildBookmarkModel( +static BrowserContextKeyedService* BuildBookmarkModel( content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); BookmarkModel* bookmark_model = new BookmarkModel(profile); @@ -441,7 +445,7 @@ void TestingProfile::CreateBookmarkModel(bool delete_file) { } } -static ProfileKeyedService* BuildWebDataService( +static BrowserContextKeyedService* BuildWebDataService( content::BrowserContext* profile) { return new WebDataServiceWrapper(static_cast<Profile*>(profile)); } diff --git a/chrome/test/base/testing_profile.h b/chrome/test/base/testing_profile.h index 92535fc..e9d52d1 100644 --- a/chrome/test/base/testing_profile.h +++ b/chrome/test/base/testing_profile.h @@ -37,11 +37,11 @@ namespace quota { class SpecialStoragePolicy; } +class BrowserContextDependencyManager; class CommandLine; class ExtensionSpecialStoragePolicy; class HostContentSettingsMap; class PrefServiceSyncable; -class ProfileDependencyManager; class ProfileSyncService; class TemplateURLService; class TestingPrefServiceSyncable; @@ -343,7 +343,7 @@ class TestingProfile : public Profile { // We keep a weak pointer to the dependency manager we want to notify on our // death. Defaults to the Singleton implementation but overridable for // testing. - ProfileDependencyManager* profile_dependency_manager_; + BrowserContextDependencyManager* profile_dependency_manager_; scoped_ptr<content::MockResourceContext> resource_context_; |