OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_FACTORY_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/memory/singleton.h" |
| 10 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
| 11 |
| 12 namespace syncer { |
| 13 class Invalidator; |
| 14 } |
| 15 |
| 16 class InvalidationFrontend; |
| 17 class Profile; |
| 18 |
| 19 namespace invalidation { |
| 20 |
| 21 // A ProfileKeyedServiceFactory to construct InvalidationServices. The |
| 22 // implementation of the InvalidationService may be completely different on |
| 23 // different platforms; this class should help to hide this complexity. It also |
| 24 // exposes some factory methods that are useful for setting up tests that rely |
| 25 // on invalidations. |
| 26 class InvalidationServiceFactory : public ProfileKeyedServiceFactory { |
| 27 public: |
| 28 // TODO(rlarocque): Re-enable this once InvalidationFrontend can extend |
| 29 // ProfileKeyedService. |
| 30 // static InvalidationFrontend* GetForProfile(Profile* profile); |
| 31 |
| 32 static InvalidationServiceFactory* GetInstance(); |
| 33 |
| 34 static ProfileKeyedService* BuildP2PInvalidationServiceFor(Profile* profile); |
| 35 static ProfileKeyedService* BuildTestServiceInstanceFor(Profile* profile); |
| 36 |
| 37 private: |
| 38 friend struct DefaultSingletonTraits<InvalidationServiceFactory>; |
| 39 |
| 40 InvalidationServiceFactory(); |
| 41 virtual ~InvalidationServiceFactory(); |
| 42 |
| 43 // ProfileKeyedServiceFactory: |
| 44 virtual ProfileKeyedService* BuildServiceInstanceFor( |
| 45 content::BrowserContext* profile) const OVERRIDE; |
| 46 // TODO(rlarocque): Use this class, not InvalidatorStorage, to register |
| 47 // for user prefs. |
| 48 // virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(InvalidationServiceFactory); |
| 51 }; |
| 52 |
| 53 } // namespace invalidation |
| 54 |
| 55 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_FACTORY_H_ |
OLD | NEW |