Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / chrome / browser / prefs / ios_chrome_pref_service_factory.h
blob5168d294b977e11e83efcf9f3a39905f0ba578f3
1 // Copyright 2015 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 IOS_CHROME_BROWSER_PREFS_IOS_CHROME_PREF_SERVICE_FACTORY_H_
6 #define IOS_CHROME_BROWSER_PREFS_IOS_CHROME_PREF_SERVICE_FACTORY_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
11 class PrefRegistry;
12 class PrefService;
13 class PrefStore;
14 class TrackedPreferenceValidationDelegate;
16 namespace base {
17 class FilePath;
18 class SequencedTaskRunner;
21 namespace ios {
22 class ChromeBrowserState;
25 namespace policy {
26 class PolicyService;
29 namespace syncable_prefs {
30 class PrefServiceSyncable;
33 namespace user_prefs {
34 class PrefRegistrySyncable;
37 // Factory methods that create and initialize a new instance of a PrefService
38 // for Chrome on iOS with the applicable PrefStores. The |pref_filename| points
39 // to the user preference file. This is the usual way to create a new
40 // PrefService. |policy_service| is used as the source for mandatory or
41 // recommended policies. |pref_registry| keeps the list of registered prefs and
42 // their default valuers. If |async| is true, asynchronous version is used.
43 scoped_ptr<PrefService> CreateLocalState(
44 const base::FilePath& pref_filename,
45 base::SequencedTaskRunner* pref_io_task_runner,
46 policy::PolicyService* policy_service,
47 const scoped_refptr<PrefRegistry>& pref_registry,
48 bool async);
50 scoped_ptr<syncable_prefs::PrefServiceSyncable> CreateBrowserStatePrefs(
51 const base::FilePath& browser_state_path,
52 base::SequencedTaskRunner* pref_io_task_runner,
53 TrackedPreferenceValidationDelegate* validation_delegate,
54 policy::PolicyService* policy_service,
55 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry,
56 bool async);
58 // Creates an incognito copy of |pref_service| that shares most prefs but uses
59 // a fresh non-persistent overlay for the user pref store.
60 scoped_ptr<syncable_prefs::PrefServiceSyncable>
61 CreateIncognitoBrowserStatePrefs(
62 syncable_prefs::PrefServiceSyncable* main_pref_store);
64 #endif // IOS_CHROME_BROWSER_PREFS_IOS_CHROME_PREF_SERVICE_FACTORY_H_