Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / prefs / chrome_pref_service_factory.h
blob3456463fc6759cd08729b58969338a0f5a0c9843
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.
5 #ifndef CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
11 namespace base {
12 class FilePath;
13 class SequencedTaskRunner;
16 namespace policy {
17 class PolicyService;
20 namespace user_prefs {
21 class PrefRegistrySyncable;
24 class ManagedUserSettingsService;
25 class PrefHashStore;
26 class PrefRegistry;
27 class PrefService;
28 class PrefServiceSyncable;
29 class PrefStore;
31 namespace chrome_prefs {
33 // Factory methods that create and initialize a new instance of a
34 // PrefService for Chrome with the applicable PrefStores. The
35 // |pref_filename| points to the user preference file. This is the
36 // usual way to create a new PrefService.
37 // |extension_pref_store| is used as the source for extension-controlled
38 // preferences and may be NULL.
39 // |policy_service| is used as the source for mandatory or recommended
40 // policies.
41 // |pref_registry| keeps the list of registered prefs and their default values.
42 // If |async| is true, asynchronous version is used.
43 // Notifies using PREF_INITIALIZATION_COMPLETED in the end. Details is set to
44 // the created PrefService or NULL if creation has failed. Note, it is
45 // guaranteed that in asynchronous version initialization happens after this
46 // function returned.
48 scoped_ptr<PrefService> CreateLocalState(
49 const base::FilePath& pref_filename,
50 base::SequencedTaskRunner* pref_io_task_runner,
51 policy::PolicyService* policy_service,
52 const scoped_refptr<PrefRegistry>& pref_registry,
53 bool async);
55 scoped_ptr<PrefServiceSyncable> CreateProfilePrefs(
56 const base::FilePath& pref_filename,
57 base::SequencedTaskRunner* pref_io_task_runner,
58 policy::PolicyService* policy_service,
59 ManagedUserSettingsService* managed_user_settings,
60 scoped_ptr<PrefHashStore> pref_hash_store,
61 const scoped_refptr<PrefStore>& extension_prefs,
62 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry,
63 bool async);
65 } // namespace chrome_prefs
67 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_