Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: chrome/browser/profile_resetter/triggered_profile_resetter_factory.h

Issue 1294923003: Add a triggered profile reset mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Grt feedback Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698