From f1484c5242850142011c4db4572b9b742f6b56f5 Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Wed, 22 May 2013 23:25:44 +0000 Subject: 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 --- apps/app_restore_service.h | 4 ++-- apps/app_restore_service_factory.cc | 15 ++++++++------- apps/app_restore_service_factory.h | 8 ++++---- apps/shell_window_geometry_cache.cc | 9 +++++---- apps/shell_window_geometry_cache.h | 10 +++++----- apps/shortcut_manager.h | 2 +- apps/shortcut_manager_factory.cc | 15 ++++++++------- apps/shortcut_manager_factory.h | 8 ++++---- 8 files changed, 37 insertions(+), 34 deletions(-) (limited to 'apps') diff --git a/apps/app_restore_service.h b/apps/app_restore_service.h index 32c5738..97dcd88 100644 --- a/apps/app_restore_service.h +++ b/apps/app_restore_service.h @@ -29,7 +29,7 @@ using extensions::app_file_handler_util::SavedFileEntry; namespace apps { // Tracks what apps need to be restarted when the browser restarts. -class AppRestoreService : public ProfileKeyedService, +class AppRestoreService : public BrowserContextKeyedService, public content::NotificationObserver, public extensions::ShellWindowRegistry::Observer { public: @@ -54,7 +54,7 @@ class AppRestoreService : public ProfileKeyedService, virtual void OnShellWindowIconChanged(ShellWindow* shell_window) OVERRIDE; virtual void OnShellWindowRemoved(ShellWindow* shell_window) OVERRIDE; - // ProfileKeyedService. + // BrowserContextKeyedService. virtual void Shutdown() OVERRIDE; void RecordAppStart(const std::string& extension_id); diff --git a/apps/app_restore_service_factory.cc b/apps/app_restore_service_factory.cc index 4086c7a..b477ce8 100644 --- a/apps/app_restore_service_factory.cc +++ b/apps/app_restore_service_factory.cc @@ -14,14 +14,14 @@ namespace apps { // static AppRestoreService* AppRestoreServiceFactory::GetForProfile(Profile* profile) { return static_cast( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static void AppRestoreServiceFactory::ResetForProfile(Profile* profile) { AppRestoreServiceFactory* factory = GetInstance(); - factory->ProfileShutdown(profile); - factory->ProfileDestroyed(profile); + factory->BrowserContextShutdown(profile); + factory->BrowserContextDestroyed(profile); } AppRestoreServiceFactory* AppRestoreServiceFactory::GetInstance() { @@ -29,20 +29,21 @@ AppRestoreServiceFactory* AppRestoreServiceFactory::GetInstance() { } AppRestoreServiceFactory::AppRestoreServiceFactory() - : ProfileKeyedServiceFactory("AppRestoreService", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "AppRestoreService", + BrowserContextDependencyManager::GetInstance()) { DependsOn(extensions::ShellWindowRegistry::Factory::GetInstance()); } AppRestoreServiceFactory::~AppRestoreServiceFactory() { } -ProfileKeyedService* AppRestoreServiceFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* AppRestoreServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new AppRestoreService(static_cast(profile)); } -bool AppRestoreServiceFactory::ServiceIsCreatedWithProfile() const { +bool AppRestoreServiceFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/apps/app_restore_service_factory.h b/apps/app_restore_service_factory.h index 5076753..6012904 100644 --- a/apps/app_restore_service_factory.h +++ b/apps/app_restore_service_factory.h @@ -17,7 +17,7 @@ class AppRestoreService; // Singleton that owns all AppRestoreServices and associates them with // Profiles. Listens for the Profile's destruction notification and cleans up // the associated AppRestoreService. -class AppRestoreServiceFactory : public ProfileKeyedServiceFactory { +class AppRestoreServiceFactory : public BrowserContextKeyedServiceFactory { public: static AppRestoreService* GetForProfile(Profile* profile); @@ -31,10 +31,10 @@ class AppRestoreServiceFactory : public ProfileKeyedServiceFactory { AppRestoreServiceFactory(); virtual ~AppRestoreServiceFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; }; } // namespace apps diff --git a/apps/shell_window_geometry_cache.cc b/apps/shell_window_geometry_cache.cc index 9b2a4f5..19901d9 100644 --- a/apps/shell_window_geometry_cache.cc +++ b/apps/shell_window_geometry_cache.cc @@ -236,7 +236,7 @@ void ShellWindowGeometryCache::OnExtensionUnloaded( ShellWindowGeometryCache* ShellWindowGeometryCache::Factory::GetForContext( content::BrowserContext* context, bool create) { return static_cast( - GetInstance()->GetServiceForProfile(context, create)); + GetInstance()->GetServiceForBrowserContext(context, create)); } ShellWindowGeometryCache::Factory* @@ -245,15 +245,16 @@ ShellWindowGeometryCache::Factory::GetInstance() { } ShellWindowGeometryCache::Factory::Factory() - : ProfileKeyedServiceFactory("ShellWindowGeometryCache", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ShellWindowGeometryCache", + BrowserContextDependencyManager::GetInstance()) { DependsOn(extensions::ExtensionPrefsFactory::GetInstance()); } ShellWindowGeometryCache::Factory::~Factory() { } -ProfileKeyedService* +BrowserContextKeyedService* ShellWindowGeometryCache::Factory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = Profile::FromBrowserContext(context); diff --git a/apps/shell_window_geometry_cache.h b/apps/shell_window_geometry_cache.h index c66edd6..91ea132 100644 --- a/apps/shell_window_geometry_cache.h +++ b/apps/shell_window_geometry_cache.h @@ -33,10 +33,10 @@ namespace apps { // for IO when creating a new window, and to not cause IO on every window // geometry change. class ShellWindowGeometryCache - : public ProfileKeyedService, + : public BrowserContextKeyedService, public content::NotificationObserver { public: - class Factory : public ProfileKeyedServiceFactory { + class Factory : public BrowserContextKeyedServiceFactory { public: static ShellWindowGeometryCache* GetForContext( content::BrowserContext* context, @@ -49,8 +49,8 @@ class ShellWindowGeometryCache Factory(); virtual ~Factory(); - // ProfileKeyedServiceFactory - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; virtual content::BrowserContext* GetBrowserContextToUse( @@ -79,7 +79,7 @@ class ShellWindowGeometryCache gfx::Rect* bounds, ui::WindowShowState* state) const; - // ProfileKeyedService + // BrowserContextKeyedService virtual void Shutdown() OVERRIDE; // Maximum number of windows we'll cache the geometry for per app. diff --git a/apps/shortcut_manager.h b/apps/shortcut_manager.h index 2573f45..a0efb82 100644 --- a/apps/shortcut_manager.h +++ b/apps/shortcut_manager.h @@ -16,7 +16,7 @@ class Profile; namespace apps { // This class manages the installation of shortcuts for platform apps. -class ShortcutManager : public ProfileKeyedService, +class ShortcutManager : public BrowserContextKeyedService, public content::NotificationObserver { public: explicit ShortcutManager(Profile* profile); diff --git a/apps/shortcut_manager_factory.cc b/apps/shortcut_manager_factory.cc index 4d2b513..5aa339e 100644 --- a/apps/shortcut_manager_factory.cc +++ b/apps/shortcut_manager_factory.cc @@ -13,14 +13,14 @@ namespace apps { // static ShortcutManager* ShortcutManagerFactory::GetForProfile(Profile* profile) { return static_cast( - GetInstance()->GetServiceForProfile(profile, true)); + GetInstance()->GetServiceForBrowserContext(profile, true)); } // static void ShortcutManagerFactory::ResetForProfile(Profile* profile) { ShortcutManagerFactory* factory = GetInstance(); - factory->ProfileShutdown(profile); - factory->ProfileDestroyed(profile); + factory->BrowserContextShutdown(profile); + factory->BrowserContextDestroyed(profile); } ShortcutManagerFactory* ShortcutManagerFactory::GetInstance() { @@ -28,19 +28,20 @@ ShortcutManagerFactory* ShortcutManagerFactory::GetInstance() { } ShortcutManagerFactory::ShortcutManagerFactory() - : ProfileKeyedServiceFactory("ShortcutManager", - ProfileDependencyManager::GetInstance()) { + : BrowserContextKeyedServiceFactory( + "ShortcutManager", + BrowserContextDependencyManager::GetInstance()) { } ShortcutManagerFactory::~ShortcutManagerFactory() { } -ProfileKeyedService* ShortcutManagerFactory::BuildServiceInstanceFor( +BrowserContextKeyedService* ShortcutManagerFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new ShortcutManager(static_cast(profile)); } -bool ShortcutManagerFactory::ServiceIsCreatedWithProfile() const { +bool ShortcutManagerFactory::ServiceIsCreatedWithBrowserContext() const { return true; } diff --git a/apps/shortcut_manager_factory.h b/apps/shortcut_manager_factory.h index 7f928e3..9f8add9 100644 --- a/apps/shortcut_manager_factory.h +++ b/apps/shortcut_manager_factory.h @@ -19,7 +19,7 @@ class ShortcutManager; // Profiles. Listens for the Profile's destruction notification and cleans up // the associated ShortcutManager. // ShortcutManagers should not exist in incognito profiles. -class ShortcutManagerFactory : public ProfileKeyedServiceFactory { +class ShortcutManagerFactory : public BrowserContextKeyedServiceFactory { public: static ShortcutManager* GetForProfile(Profile* profile); @@ -33,10 +33,10 @@ class ShortcutManagerFactory : public ProfileKeyedServiceFactory { ShortcutManagerFactory(); virtual ~ShortcutManagerFactory(); - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( + // BrowserContextKeyedServiceFactory: + virtual BrowserContextKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; }; } // namespace apps -- cgit v1.1