1// Copyright 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_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_ 6#define CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_ 7 8#include "base/basictypes.h" 9#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" 10 11template <typename T> 12struct DefaultSingletonTraits; 13 14class PrefRegistrySimple; 15 16namespace content { 17class BrowserContext; 18} 19 20namespace user_prefs { 21class PrefRegistrySyncable; 22} 23 24class AutomaticProfileResetter; 25 26class AutomaticProfileResetterFactory 27 : public BrowserContextKeyedServiceFactory { 28 public: 29 static AutomaticProfileResetter* GetForBrowserContext( 30 content::BrowserContext* context); 31 static AutomaticProfileResetterFactory* GetInstance(); 32 33 // Registers Local State preferences. 34 static void RegisterPrefs(PrefRegistrySimple* registry); 35 36 private: 37 friend struct DefaultSingletonTraits<AutomaticProfileResetterFactory>; 38 39 AutomaticProfileResetterFactory(); 40 virtual ~AutomaticProfileResetterFactory(); 41 42 // BrowserContextKeyedServiceFactory: 43 virtual BrowserContextKeyedService* BuildServiceInstanceFor( 44 content::BrowserContext* context) const OVERRIDE; 45 46 // BrowserContextKeyedBaseFactory: 47 virtual void RegisterProfilePrefs( 48 user_prefs::PrefRegistrySyncable* registry) OVERRIDE; 49 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; 50 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; 51 52 DISALLOW_COPY_AND_ASSIGN(AutomaticProfileResetterFactory); 53}; 54 55#endif // CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_ 56