OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ |
6 #define CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ | 6 #define CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ |
7 | 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 |
8 namespace base { | 10 namespace base { |
9 class FilePath; | 11 class FilePath; |
10 class SequencedTaskRunner; | 12 class SequencedTaskRunner; |
11 } | 13 } |
12 | 14 |
13 namespace policy { | 15 namespace policy { |
14 class PolicyService; | 16 class PolicyService; |
15 } | 17 } |
16 | 18 |
17 class PrefServiceSimple; | 19 class PrefRegistry; |
| 20 class PrefService; |
18 class PrefServiceSyncable; | 21 class PrefServiceSyncable; |
19 class PrefStore; | 22 class PrefStore; |
20 | 23 |
21 namespace chrome_prefs { | 24 namespace chrome_prefs { |
22 | 25 |
23 // Factory methods that create and initialize a new instance of a | 26 // Factory methods that create and initialize a new instance of a |
24 // PrefService for Chrome with the applicable PrefStores. The | 27 // PrefService for Chrome with the applicable PrefStores. The |
25 // |pref_filename| points to the user preference file. This is the | 28 // |pref_filename| points to the user preference file. This is the |
26 // usual way to create a new PrefService. | 29 // usual way to create a new PrefService. |
27 // |extension_pref_store| is used as the source for extension-controlled | 30 // |extension_pref_store| is used as the source for extension-controlled |
28 // preferences and may be NULL. | 31 // preferences and may be NULL. |
29 // |policy_service| is used as the source for mandatory or recommended | 32 // |policy_service| is used as the source for mandatory or recommended |
30 // policies. | 33 // policies. |
| 34 // |pref_registry| keeps the list of registered prefs and their default values. |
31 // If |async| is true, asynchronous version is used. | 35 // If |async| is true, asynchronous version is used. |
32 // Notifies using PREF_INITIALIZATION_COMPLETED in the end. Details is set to | 36 // Notifies using PREF_INITIALIZATION_COMPLETED in the end. Details is set to |
33 // the created PrefService or NULL if creation has failed. Note, it is | 37 // the created PrefService or NULL if creation has failed. Note, it is |
34 // guaranteed that in asynchronous version initialization happens after this | 38 // guaranteed that in asynchronous version initialization happens after this |
35 // function returned. | 39 // function returned. |
36 | 40 |
37 PrefServiceSimple* CreateLocalState( | 41 PrefService* CreateLocalState( |
38 const base::FilePath& pref_filename, | 42 const base::FilePath& pref_filename, |
39 base::SequencedTaskRunner* pref_io_task_runner, | 43 base::SequencedTaskRunner* pref_io_task_runner, |
40 policy::PolicyService* policy_service, | 44 policy::PolicyService* policy_service, |
41 PrefStore* extension_prefs, | 45 const scoped_refptr<PrefStore>& extension_prefs, |
| 46 const scoped_refptr<PrefRegistry>& pref_registry, |
42 bool async); | 47 bool async); |
43 | 48 |
44 PrefServiceSyncable* CreateProfilePrefs( | 49 PrefServiceSyncable* CreateProfilePrefs( |
45 const base::FilePath& pref_filename, | 50 const base::FilePath& pref_filename, |
46 base::SequencedTaskRunner* pref_io_task_runner, | 51 base::SequencedTaskRunner* pref_io_task_runner, |
47 policy::PolicyService* policy_service, | 52 policy::PolicyService* policy_service, |
48 PrefStore* extension_prefs, | 53 const scoped_refptr<PrefStore>& extension_prefs, |
49 bool async); | 54 bool async); |
50 | 55 |
51 } // namespace chrome_prefs | 56 } // namespace chrome_prefs |
52 | 57 |
53 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ | 58 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ |
OLD | NEW |