| 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> |
| 9 |
| 8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 | 11 |
| 11 class PrefRegistry; | 12 class PrefRegistry; |
| 12 class PrefService; | 13 class PrefService; |
| 13 class PrefStore; | 14 class PrefStore; |
| 14 | 15 |
| 15 namespace base { | 16 namespace base { |
| 16 class FilePath; | 17 class FilePath; |
| 17 class SequencedTaskRunner; | 18 class SequencedTaskRunner; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace ios { | 21 namespace ios { |
| 21 class ChromeBrowserState; | 22 class ChromeBrowserState; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace syncable_prefs { | 25 namespace syncable_prefs { |
| 25 class PrefServiceSyncable; | 26 class PrefServiceSyncable; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace user_prefs { | 29 namespace user_prefs { |
| 29 class PrefRegistrySyncable; | 30 class PrefRegistrySyncable; |
| 30 } | 31 } |
| 31 | 32 |
| 32 // 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 |
| 33 // 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 |
| 34 // 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 |
| 35 // PrefService. |pref_registry| keeps the list of registered prefs and their | 36 // PrefService. |pref_registry| keeps the list of registered prefs and their |
| 36 // default values. | 37 // default values. |
| 37 scoped_ptr<PrefService> CreateLocalState( | 38 std::unique_ptr<PrefService> CreateLocalState( |
| 38 const base::FilePath& pref_filename, | 39 const base::FilePath& pref_filename, |
| 39 base::SequencedTaskRunner* pref_io_task_runner, | 40 base::SequencedTaskRunner* pref_io_task_runner, |
| 40 const scoped_refptr<PrefRegistry>& pref_registry); | 41 const scoped_refptr<PrefRegistry>& pref_registry); |
| 41 | 42 |
| 42 scoped_ptr<syncable_prefs::PrefServiceSyncable> CreateBrowserStatePrefs( | 43 std::unique_ptr<syncable_prefs::PrefServiceSyncable> CreateBrowserStatePrefs( |
| 43 const base::FilePath& browser_state_path, | 44 const base::FilePath& browser_state_path, |
| 44 base::SequencedTaskRunner* pref_io_task_runner, | 45 base::SequencedTaskRunner* pref_io_task_runner, |
| 45 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry); | 46 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry); |
| 46 | 47 |
| 47 // 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 |
| 48 // a fresh non-persistent overlay for the user pref store. | 49 // a fresh non-persistent overlay for the user pref store. |
| 49 scoped_ptr<syncable_prefs::PrefServiceSyncable> | 50 std::unique_ptr<syncable_prefs::PrefServiceSyncable> |
| 50 CreateIncognitoBrowserStatePrefs( | 51 CreateIncognitoBrowserStatePrefs( |
| 51 syncable_prefs::PrefServiceSyncable* main_pref_store); | 52 syncable_prefs::PrefServiceSyncable* main_pref_store); |
| 52 | 53 |
| 53 #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 |