| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_INVALIDATION_PROFILE_INVALIDATION_PROVIDER_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_INVALIDATION_PROFILE_INVALIDATION_PROVIDER_FACTORY_H_ |
| 6 #define CHROME_BROWSER_INVALIDATION_PROFILE_INVALIDATION_PROVIDER_FACTORY_H_ | 6 #define CHROME_BROWSER_INVALIDATION_PROFILE_INVALIDATION_PROVIDER_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 10 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 11 | 11 |
| 12 namespace policy { | 12 namespace policy { |
| 13 class AffiliatedInvalidationServiceProviderTest; |
| 13 class DeviceCloudPolicyInvalidatorTest; | 14 class DeviceCloudPolicyInvalidatorTest; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace user_prefs { | 17 namespace user_prefs { |
| 17 class PrefRegistrySyncable; | 18 class PrefRegistrySyncable; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace syncer { | 21 namespace syncer { |
| 21 class Invalidator; | 22 class Invalidator; |
| 22 } | 23 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 41 static ProfileInvalidationProvider* GetForProfile(Profile* profile); | 42 static ProfileInvalidationProvider* GetForProfile(Profile* profile); |
| 42 | 43 |
| 43 static ProfileInvalidationProviderFactory* GetInstance(); | 44 static ProfileInvalidationProviderFactory* GetInstance(); |
| 44 | 45 |
| 45 // Switches service creation to go through |testing_factory| for all browser | 46 // Switches service creation to go through |testing_factory| for all browser |
| 46 // contexts. | 47 // contexts. |
| 47 void RegisterTestingFactory(TestingFactoryFunction testing_factory); | 48 void RegisterTestingFactory(TestingFactoryFunction testing_factory); |
| 48 | 49 |
| 49 private: | 50 private: |
| 50 friend class ProfileInvalidationProviderFactoryTestBase; | 51 friend class ProfileInvalidationProviderFactoryTestBase; |
| 52 friend class policy::AffiliatedInvalidationServiceProviderTest; |
| 51 friend class policy::DeviceCloudPolicyInvalidatorTest; | 53 friend class policy::DeviceCloudPolicyInvalidatorTest; |
| 52 friend struct DefaultSingletonTraits<ProfileInvalidationProviderFactory>; | 54 friend struct DefaultSingletonTraits<ProfileInvalidationProviderFactory>; |
| 53 | 55 |
| 54 ProfileInvalidationProviderFactory(); | 56 ProfileInvalidationProviderFactory(); |
| 55 ~ProfileInvalidationProviderFactory() override; | 57 ~ProfileInvalidationProviderFactory() override; |
| 56 | 58 |
| 57 // BrowserContextKeyedServiceFactory: | 59 // BrowserContextKeyedServiceFactory: |
| 58 KeyedService* BuildServiceInstanceFor( | 60 KeyedService* BuildServiceInstanceFor( |
| 59 content::BrowserContext* context) const override; | 61 content::BrowserContext* context) const override; |
| 60 void RegisterProfilePrefs( | 62 void RegisterProfilePrefs( |
| 61 user_prefs::PrefRegistrySyncable* registry) override; | 63 user_prefs::PrefRegistrySyncable* registry) override; |
| 62 | 64 |
| 63 TestingFactoryFunction testing_factory_; | 65 TestingFactoryFunction testing_factory_; |
| 64 | 66 |
| 65 DISALLOW_COPY_AND_ASSIGN(ProfileInvalidationProviderFactory); | 67 DISALLOW_COPY_AND_ASSIGN(ProfileInvalidationProviderFactory); |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 } // namespace invalidation | 70 } // namespace invalidation |
| 69 | 71 |
| 70 #endif // CHROME_BROWSER_INVALIDATION_PROFILE_INVALIDATION_PROVIDER_FACTORY_H_ | 72 #endif // CHROME_BROWSER_INVALIDATION_PROFILE_INVALIDATION_PROVIDER_FACTORY_H_ |
| OLD | NEW |