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

Side by Side Diff: chrome/browser/prefs/chrome_pref_service_factory.h

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review. Created 8 years 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_PREFS_CHROME_PREF_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_
7
8 #include "chrome/browser/prefs/pref_service_builder.h"
9
10 namespace base {
11 class SequencedTaskRunner;
12 }
13
14 namespace policy {
15 class PolicyService;
16 }
17
18 class FilePath;
19 class PrefServiceBuilder;
20 class PrefServiceSimple;
21 class PrefServiceSyncable;
22 class PrefStore;
23
24 class ChromePrefServiceFactory {
25 public:
26 ChromePrefServiceFactory();
27 virtual ~ChromePrefServiceFactory();
28
29 // Factory methods that create and initialize a new instance of a
30 // PrefService for Chrome with the applicable PrefStores. The
31 // |pref_filename| points to the user preference file. This is the
32 // usual way to create a new PrefService.
33 // |extension_pref_store| is used as the source for extension-controlled
34 // preferences and may be NULL.
35 // |policy_service| is used as the source for mandatory or recommended
36 // policies.
37 // The PrefService takes ownership of |extension_pref_store|.
Mattias Nissler (ping if slow) 2012/12/20 13:41:52 PrefStores are RefCounted, please remove this sent
Jói 2012/12/20 16:30:31 Done.
38 // If |async| is true, asynchronous version is used.
39 // Notifies using PREF_INITIALIZATION_COMPLETED in the end. Details is set to
40 // the created PrefService or NULL if creation has failed. Note, it is
41 // guaranteed that in asynchronous version initialization happens after this
42 // function returned.
43
44 PrefServiceSimple* CreateLocalState(
45 const FilePath& pref_filename,
46 base::SequencedTaskRunner* pref_io_task_runner,
47 policy::PolicyService* policy_service,
48 PrefStore* extension_prefs,
49 bool async);
50
51 PrefServiceSyncable* CreateProfilePrefs(
52 const FilePath& pref_filename,
53 base::SequencedTaskRunner* pref_io_task_runner,
54 policy::PolicyService* policy_service,
55 PrefStore* extension_prefs,
56 bool async);
57
58 private:
59 void PrepareBuilder(
60 const FilePath& pref_filename,
61 base::SequencedTaskRunner* pref_io_task_runner,
62 policy::PolicyService* policy_service,
63 PrefStore* extension_prefs,
64 bool async);
65
66 void ResetDefaultState();
67
68 PrefServiceBuilder builder_;
69
70 DISALLOW_COPY_AND_ASSIGN(ChromePrefServiceFactory);
71 };
72
73 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698