| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 IOS_CHROME_BROWSER_PREFS_IOS_CHROME_PREF_SERVICE_FACTORY_H_ | 5 #ifndef IOS_CHROME_BROWSER_PREFS_IOS_CHROME_PREF_SERVICE_FACTORY_H_ |
| 6 #define IOS_CHROME_BROWSER_PREFS_IOS_CHROME_PREF_SERVICE_FACTORY_H_ | 6 #define IOS_CHROME_BROWSER_PREFS_IOS_CHROME_PREF_SERVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 | 11 |
| 12 class PrefRegistry; | 12 class PrefRegistry; |
| 13 class PrefService; | 13 class PrefService; |
| 14 class PrefStore; | 14 class PrefStore; |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class FilePath; | 17 class FilePath; |
| 18 class SequencedTaskRunner; | 18 class SequencedTaskRunner; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace ios { | 21 namespace ios { |
| 22 class ChromeBrowserState; | 22 class ChromeBrowserState; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace syncable_prefs { | 25 namespace sync_preferences { |
| 26 class PrefServiceSyncable; | 26 class PrefServiceSyncable; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace user_prefs { | 29 namespace user_prefs { |
| 30 class PrefRegistrySyncable; | 30 class PrefRegistrySyncable; |
| 31 } | 31 } |
| 32 | 32 |
| 33 // Factory methods that create and initialize a new instance of a PrefService | 33 // Factory methods that create and initialize a new instance of a PrefService |
| 34 // for Chrome on iOS with the applicable PrefStores. The |pref_filename| points | 34 // for Chrome on iOS with the applicable PrefStores. The |pref_filename| points |
| 35 // to the user preference file. This is the usual way to create a new | 35 // to the user preference file. This is the usual way to create a new |
| 36 // PrefService. |pref_registry| keeps the list of registered prefs and their | 36 // PrefService. |pref_registry| keeps the list of registered prefs and their |
| 37 // default values. | 37 // default values. |
| 38 std::unique_ptr<PrefService> CreateLocalState( | 38 std::unique_ptr<PrefService> CreateLocalState( |
| 39 const base::FilePath& pref_filename, | 39 const base::FilePath& pref_filename, |
| 40 base::SequencedTaskRunner* pref_io_task_runner, | 40 base::SequencedTaskRunner* pref_io_task_runner, |
| 41 const scoped_refptr<PrefRegistry>& pref_registry); | 41 const scoped_refptr<PrefRegistry>& pref_registry); |
| 42 | 42 |
| 43 std::unique_ptr<syncable_prefs::PrefServiceSyncable> CreateBrowserStatePrefs( | 43 std::unique_ptr<sync_preferences::PrefServiceSyncable> CreateBrowserStatePrefs( |
| 44 const base::FilePath& browser_state_path, | 44 const base::FilePath& browser_state_path, |
| 45 base::SequencedTaskRunner* pref_io_task_runner, | 45 base::SequencedTaskRunner* pref_io_task_runner, |
| 46 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry); | 46 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry); |
| 47 | 47 |
| 48 // Creates an incognito copy of |pref_service| that shares most prefs but uses | 48 // Creates an incognito copy of |pref_service| that shares most prefs but uses |
| 49 // a fresh non-persistent overlay for the user pref store. | 49 // a fresh non-persistent overlay for the user pref store. |
| 50 std::unique_ptr<syncable_prefs::PrefServiceSyncable> | 50 std::unique_ptr<sync_preferences::PrefServiceSyncable> |
| 51 CreateIncognitoBrowserStatePrefs( | 51 CreateIncognitoBrowserStatePrefs( |
| 52 syncable_prefs::PrefServiceSyncable* main_pref_store); | 52 sync_preferences::PrefServiceSyncable* main_pref_store); |
| 53 | 53 |
| 54 #endif // IOS_CHROME_BROWSER_PREFS_IOS_CHROME_PREF_SERVICE_FACTORY_H_ | 54 #endif // IOS_CHROME_BROWSER_PREFS_IOS_CHROME_PREF_SERVICE_FACTORY_H_ |
| OLD | NEW |