Index: trunk/src/chrome/browser/invalidation/invalidation_service_factory.h |
=================================================================== |
--- trunk/src/chrome/browser/invalidation/invalidation_service_factory.h (revision 208346) |
+++ trunk/src/chrome/browser/invalidation/invalidation_service_factory.h (working copy) |
@@ -9,22 +9,15 @@ |
#include "base/memory/singleton.h" |
#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" |
-namespace user_prefs { |
-class PrefRegistrySyncable; |
-} |
- |
namespace syncer { |
class Invalidator; |
} |
+class InvalidationFrontend; |
class Profile; |
namespace invalidation { |
-class InvalidationService; |
-class P2PInvalidationService; |
-class FakeInvalidationService; |
- |
// 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 |
@@ -32,19 +25,17 @@ |
// on invalidations. |
class InvalidationServiceFactory : public BrowserContextKeyedServiceFactory { |
public: |
- static InvalidationService* GetForProfile(Profile* profile); |
+ // TODO(rlarocque): Re-enable this once InvalidationFrontend can extend |
+ // BrowserContextKeyedService. |
+ // static InvalidationFrontend* GetForProfile(Profile* profile); |
static InvalidationServiceFactory* GetInstance(); |
- // A helper function to set this factory to return FakeInvalidationServices |
- // instead of the default InvalidationService objects. |
- void SetBuildOnlyFakeInvalidatorsForTest(bool test_mode_enabled); |
+ static BrowserContextKeyedService* BuildP2PInvalidationServiceFor( |
+ Profile* profile); |
+ static BrowserContextKeyedService* BuildTestServiceInstanceFor( |
+ Profile* profile); |
- // These helper functions to set the factory to build a test-only type of |
- // invalidator and return the instance immeidately. |
- P2PInvalidationService* BuildAndUseP2PInvalidationServiceForTest( |
- content::BrowserContext* context); |
- |
private: |
friend struct DefaultSingletonTraits<InvalidationServiceFactory>; |
@@ -53,13 +44,11 @@ |
// BrowserContextKeyedServiceFactory: |
virtual BrowserContextKeyedService* BuildServiceInstanceFor( |
- content::BrowserContext* context) const OVERRIDE; |
- virtual void RegisterUserPrefs( |
- user_prefs::PrefRegistrySyncable* registry) OVERRIDE; |
+ content::BrowserContext* profile) const OVERRIDE; |
+ // TODO(rlarocque): Use this class, not InvalidatorStorage, to register |
+ // for user prefs. |
+ // virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; |
- // If true, this factory will return only FakeInvalidationService instances. |
- bool build_fake_invalidators_; |
- |
DISALLOW_COPY_AND_ASSIGN(InvalidationServiceFactory); |
}; |