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/scoped_ptr.h" | |
9 | |
8 namespace base { | 10 namespace base { |
9 class SequencedTaskRunner; | 11 class SequencedTaskRunner; |
10 } | 12 } |
11 | 13 |
12 namespace policy { | 14 namespace policy { |
13 class PolicyService; | 15 class PolicyService; |
14 } | 16 } |
15 | 17 |
16 class FilePath; | 18 class FilePath; |
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| is the registry object to retrieve registration | |
35 // information from; PrefService takes ownership (not used for | |
36 // CreateProfilePrefs yet). | |
Mattias Nissler (ping if slow)
2013/01/25 14:57:11
Once we use it for profile prefs, there's a slight
Jói
2013/01/29 16:10:02
Fixed this by having a separate PrefRegistry that
| |
31 // If |async| is true, asynchronous version is used. | 37 // If |async| is true, asynchronous version is used. |
32 // Notifies using PREF_INITIALIZATION_COMPLETED in the end. Details is set to | 38 // 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 | 39 // the created PrefService or NULL if creation has failed. Note, it is |
34 // guaranteed that in asynchronous version initialization happens after this | 40 // guaranteed that in asynchronous version initialization happens after this |
35 // function returned. | 41 // function returned. |
36 | 42 |
37 PrefServiceSimple* CreateLocalState( | 43 PrefService* CreateLocalState( |
38 const FilePath& pref_filename, | 44 const FilePath& pref_filename, |
39 base::SequencedTaskRunner* pref_io_task_runner, | 45 base::SequencedTaskRunner* pref_io_task_runner, |
40 policy::PolicyService* policy_service, | 46 policy::PolicyService* policy_service, |
41 PrefStore* extension_prefs, | 47 PrefStore* extension_prefs, |
48 scoped_ptr<PrefRegistry> pref_registry, | |
42 bool async); | 49 bool async); |
43 | 50 |
44 PrefServiceSyncable* CreateProfilePrefs( | 51 PrefServiceSyncable* CreateProfilePrefs( |
45 const FilePath& pref_filename, | 52 const FilePath& pref_filename, |
46 base::SequencedTaskRunner* pref_io_task_runner, | 53 base::SequencedTaskRunner* pref_io_task_runner, |
47 policy::PolicyService* policy_service, | 54 policy::PolicyService* policy_service, |
48 PrefStore* extension_prefs, | 55 PrefStore* extension_prefs, |
49 bool async); | 56 bool async); |
50 | 57 |
51 } // namespace chrome_prefs | 58 } // namespace chrome_prefs |
52 | 59 |
53 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ | 60 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ |
OLD | NEW |