OLD | NEW |
| (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_BUILDER_H_ | |
6 #define CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_BUILDER_H_ | |
7 | |
8 #include "chrome/browser/prefs/pref_service_builder.h" | |
9 | |
10 namespace policy { | |
11 class PolicyService; | |
12 } | |
13 | |
14 class PrefStore; | |
15 | |
16 class ChromePrefServiceBuilder : public PrefServiceBuilder { | |
17 public: | |
18 ChromePrefServiceBuilder(); | |
19 virtual ~ChromePrefServiceBuilder(); | |
20 | |
21 // Factory method that creates a new instance of a PrefService for | |
22 // Chrome with the applicable PrefStores. The |pref_filename| points | |
23 // to the user preference file. This is the usual way to create a | |
24 // new PrefService. | |
25 // |extension_pref_store| is used as the source for extension-controlled | |
26 // preferences and may be NULL. | |
27 // |policy_service| is used as the source for mandatory or recommended | |
28 // policies. | |
29 // If |async| is true, asynchronous version is used. | |
30 // Notifies using PREF_INITIALIZATION_COMPLETED in the end. Details is set to | |
31 // the created PrefService or NULL if creation has failed. Note, it is | |
32 // guaranteed that in asynchronous version initialization happens after this | |
33 // function returned. | |
34 PrefService* CreateChromePrefs( | |
35 const FilePath& pref_filename, | |
36 base::SequencedTaskRunner* pref_io_task_runner, | |
37 policy::PolicyService* policy_service, | |
38 PrefStore* extension_prefs, | |
39 bool async); | |
40 | |
41 private: | |
42 void ResetDefaultState(); | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(ChromePrefServiceBuilder); | |
45 }; | |
46 | |
47 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_BUILDER_H_ | |
OLD | NEW |