summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile_resetter/automatic_profile_resetter_factory.h
blob: 6e155f4be39a048f905a4998ea27e0b08b5d02f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_
#define CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_

#include "base/basictypes.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"

template <typename T>
struct DefaultSingletonTraits;

class PrefRegistrySimple;

namespace content {
class BrowserContext;
}

namespace user_prefs {
class PrefRegistrySyncable;
}

class AutomaticProfileResetter;

class AutomaticProfileResetterFactory
    : public BrowserContextKeyedServiceFactory {
 public:
  static AutomaticProfileResetter* GetForBrowserContext(
      content::BrowserContext* context);
  static AutomaticProfileResetterFactory* GetInstance();

  // Registers Local State preferences.
  static void RegisterPrefs(PrefRegistrySimple* registry);

 private:
  friend struct DefaultSingletonTraits<AutomaticProfileResetterFactory>;

  AutomaticProfileResetterFactory();
  virtual ~AutomaticProfileResetterFactory();

  // BrowserContextKeyedServiceFactory:
  virtual BrowserContextKeyedService* BuildServiceInstanceFor(
      content::BrowserContext* context) const OVERRIDE;

  // BrowserContextKeyedBaseFactory:
  virtual void RegisterProfilePrefs(
      user_prefs::PrefRegistrySyncable* registry) OVERRIDE;
  virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE;
  virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;

  DISALLOW_COPY_AND_ASSIGN(AutomaticProfileResetterFactory);
};

#endif  // CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_