Index: chrome/browser/invalidation/invalidation_service_factory.h |
diff --git a/chrome/browser/invalidation/invalidation_service_factory.h b/chrome/browser/invalidation/invalidation_service_factory.h |
index 0b86143108176d1e8bae568e8a88d50b38579b72..a768849a83c74ae064b2537d986c0d1712830694 100644 |
--- a/chrome/browser/invalidation/invalidation_service_factory.h |
+++ b/chrome/browser/invalidation/invalidation_service_factory.h |
@@ -9,15 +9,23 @@ |
#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 InvalidationService; |
class Profile; |
namespace invalidation { |
+class InvalidationService; |
+class P2PInvalidationService; |
+class FakeInvalidationService; |
+ |
// A ProfileKeyedServiceFactory 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 |
@@ -25,14 +33,19 @@ namespace invalidation { |
// on invalidations. |
class InvalidationServiceFactory : public ProfileKeyedServiceFactory { |
public: |
- // TODO(rlarocque): Re-enable this once InvalidationFrontend can extend |
- // ProfileKeyedService. |
- // static InvalidationFrontend* GetForProfile(Profile* profile); |
+ static InvalidationService* GetForProfile(Profile* profile); |
static InvalidationServiceFactory* GetInstance(); |
- static ProfileKeyedService* BuildP2PInvalidationServiceFor(Profile* profile); |
- static ProfileKeyedService* BuildTestServiceInstanceFor(Profile* profile); |
+ // A helper function to set this factory to return a FakeInvalidationService. |
+ void SetFakeInvalidationServiceForTest(content::BrowserContext* context); |
+ |
+ // 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); |
+ FakeInvalidationService* BuildAndUseFakeInvalidationServiceForTest( |
+ content::BrowserContext* context); |
private: |
friend struct DefaultSingletonTraits<InvalidationServiceFactory>; |
@@ -42,10 +55,9 @@ class InvalidationServiceFactory : public ProfileKeyedServiceFactory { |
// ProfileKeyedServiceFactory: |
virtual ProfileKeyedService* BuildServiceInstanceFor( |
- content::BrowserContext* profile) const OVERRIDE; |
- // TODO(rlarocque): Use this class, not InvalidatorStorage, to register |
- // for user prefs. |
- // virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; |
+ content::BrowserContext* context) const OVERRIDE; |
+ virtual void RegisterUserPrefs( |
+ user_prefs::PrefRegistrySyncable* registry) OVERRIDE; |
DISALLOW_COPY_AND_ASSIGN(InvalidationServiceFactory); |
}; |