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

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 nits 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/macros.h"
9 #include "components/keyed_service/content/browser_context_keyed_service_factory .h"
10
11 namespace base {
12 template <typename T>
13 struct DefaultSingletonTraits;
14 }
15
16 namespace content {
17 class BrowserContext;
18 }
19
20 namespace user_prefs {
21 class PrefRegistrySyncable;
22 }
23
24 class TriggeredProfileResetter;
25
26 class TriggeredProfileResetterFactory
27 : public BrowserContextKeyedServiceFactory {
28 public:
29 static TriggeredProfileResetter* GetForBrowserContext(
30 content::BrowserContext* context);
31 static TriggeredProfileResetterFactory* GetInstance();
32
33 // Registers a factory function to build a TriggeredProfileResetter instance
34 // to be returned by any subsequent calls to GetForBrowserContext(). Used in
35 // browser tests that don't provide an easy way to call KeyedServiceFactory's
36 // SetTesting() methods after profile creation but before factories that
37 // return true from ServiceIsCreatedWithBrowserContext() are created.
38 static void SetGlobalTestingFactory(TestingFactoryFunction testing_factory);
engedy 2015/09/14 23:28:56 I think in the browser test you should be able to
robertshield 2015/09/21 04:16:22 Thanks, I hunted for this and somehow missed it. M
39
40 private:
41 friend struct base::DefaultSingletonTraits<TriggeredProfileResetterFactory>;
42
43 TriggeredProfileResetterFactory();
44 ~TriggeredProfileResetterFactory() override;
45
46 // BrowserContextKeyedServiceFactory:
47 KeyedService* BuildServiceInstanceFor(
48 content::BrowserContext* context) const override;
49
50 // BrowserContextKeyedBaseFactory:
51 void RegisterProfilePrefs(
52 user_prefs::PrefRegistrySyncable* registry) override;
53 bool ServiceIsCreatedWithBrowserContext() const override;
54
55 TestingFactoryFunction testing_factory_function_ = nullptr;
56
57 DISALLOW_COPY_AND_ASSIGN(TriggeredProfileResetterFactory);
58 };
59
60 #endif // CHROME_BROWSER_PROFILE_RESETTER_TRIGGERED_PROFILE_RESETTER_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698