Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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_PROFILE_RESETTER_TRIGGERED_PROFILE_RESETTER_FACTORY_H_ | |
| 6 #define CHROME_BROWSER_PROFILE_RESETTER_TRIGGERED_PROFILE_RESETTER_FACTORY_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
|
grt (UTC plus 2)
2015/09/05 12:44:14
macros.h
robertshield
2015/09/13 06:04:02
Done.
| |
| 9 #include "base/memory/scoped_ptr.h" | |
|
grt (UTC plus 2)
2015/09/05 12:44:14
unused
robertshield
2015/09/13 06:04:02
Done.
| |
| 10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" | |
| 11 | |
| 12 template <typename T> | |
| 13 struct DefaultSingletonTraits; | |
| 14 | |
| 15 class PrefRegistrySimple; | |
| 16 | |
| 17 namespace content { | |
| 18 class BrowserContext; | |
| 19 } | |
| 20 | |
| 21 namespace user_prefs { | |
| 22 class PrefRegistrySyncable; | |
| 23 } | |
| 24 | |
| 25 class TriggeredProfileResetter; | |
| 26 | |
| 27 class TriggeredProfileResetterFactory | |
| 28 : public BrowserContextKeyedServiceFactory { | |
| 29 public: | |
| 30 static TriggeredProfileResetter* GetForBrowserContext( | |
| 31 content::BrowserContext* context); | |
| 32 static TriggeredProfileResetterFactory* GetInstance(); | |
| 33 | |
| 34 // Registers a factory function to build a TriggeredProfileResetter instance | |
| 35 // to be returned by any subsequent calls to GetForBrowserContext(). Used in | |
| 36 // browser tests that don't provide an easy way to call KeyedServiceFactory's | |
| 37 // SetTesting() methods after profile creation but before factories that | |
| 38 // return true from ServiceIsCreatedWithBrowserContext() are created. | |
| 39 static void SetGlobalTestingFactory(TestingFactoryFunction testing_factory); | |
| 40 | |
| 41 private: | |
| 42 friend struct DefaultSingletonTraits<TriggeredProfileResetterFactory>; | |
| 43 | |
| 44 TriggeredProfileResetterFactory(); | |
| 45 ~TriggeredProfileResetterFactory() override; | |
| 46 | |
| 47 // BrowserContextKeyedServiceFactory: | |
| 48 KeyedService* BuildServiceInstanceFor( | |
| 49 content::BrowserContext* context) const override; | |
| 50 | |
| 51 // BrowserContextKeyedBaseFactory: | |
| 52 void RegisterProfilePrefs( | |
| 53 user_prefs::PrefRegistrySyncable* registry) override; | |
| 54 bool ServiceIsCreatedWithBrowserContext() const override; | |
| 55 | |
| 56 TestingFactoryFunction testing_factory_function_ = nullptr; | |
| 57 | |
| 58 DISALLOW_COPY_AND_ASSIGN(TriggeredProfileResetterFactory); | |
| 59 }; | |
| 60 | |
| 61 #endif // CHROME_BROWSER_PROFILE_RESETTER_TRIGGERED_PROFILE_RESETTER_FACTORY_H_ | |
| OLD | NEW |