OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ |
6 #define CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ | 6 #define CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "components/user_prefs/tracked/pref_hash_filter.h" | 17 #include "components/user_prefs/tracked/pref_hash_filter.h" |
| 18 #include "services/preferences/public/interfaces/tracked_preference_validation_d
elegate.mojom.h" |
18 | 19 |
19 class HashStoreContents; | 20 class HashStoreContents; |
20 class PersistentPrefStore; | 21 class PersistentPrefStore; |
21 class PrefHashStore; | 22 class PrefHashStore; |
22 class PrefService; | 23 class PrefService; |
23 | 24 |
24 namespace base { | 25 namespace base { |
25 class DictionaryValue; | 26 class DictionaryValue; |
26 class SequencedTaskRunner; | 27 class SequencedTaskRunner; |
| 28 class SingleThreadTaskRunner; |
27 } // namespace base | 29 } // namespace base |
28 | 30 |
29 namespace prefs { | 31 namespace prefs { |
30 namespace mojom { | 32 namespace mojom { |
31 class TrackedPreferenceValidationDelegate; | 33 class TrackedPreferenceValidationDelegate; |
32 } | 34 } |
33 } | 35 } |
34 | 36 |
35 namespace user_prefs { | 37 namespace user_prefs { |
36 class PrefRegistrySyncable; | 38 class PrefRegistrySyncable; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 static void SetPreferenceValidationRegistryPathForTesting( | 84 static void SetPreferenceValidationRegistryPathForTesting( |
83 const base::string16* path); | 85 const base::string16* path); |
84 #endif | 86 #endif |
85 | 87 |
86 // Creates a PersistentPrefStore providing access to the user preferences of | 88 // Creates a PersistentPrefStore providing access to the user preferences of |
87 // the managed profile. If |on_reset| is provided, it will be invoked if a | 89 // the managed profile. If |on_reset| is provided, it will be invoked if a |
88 // reset occurs as a result of loading the profile's prefs. | 90 // reset occurs as a result of loading the profile's prefs. |
89 // An optional |validation_delegate| will be notified | 91 // An optional |validation_delegate| will be notified |
90 // of the status of each tracked preference as they are checked. | 92 // of the status of each tracked preference as they are checked. |
91 PersistentPrefStore* CreateProfilePrefStore( | 93 PersistentPrefStore* CreateProfilePrefStore( |
| 94 const scoped_refptr<base::SingleThreadTaskRunner>& pref_task_runner, |
92 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, | 95 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, |
93 const base::Closure& on_reset_on_load, | 96 const base::Closure& on_reset_on_load, |
94 prefs::mojom::TrackedPreferenceValidationDelegate* validation_delegate); | 97 std::unique_ptr<prefs::mojom::TrackedPreferenceValidationDelegate>* |
| 98 validation_delegate); |
95 | 99 |
96 // Initializes the preferences for the managed profile with the preference | 100 // Initializes the preferences for the managed profile with the preference |
97 // values in |master_prefs|. Acts synchronously, including blocking IO. | 101 // values in |master_prefs|. Acts synchronously, including blocking IO. |
98 // Returns true on success. | 102 // Returns true on success. |
99 bool InitializePrefsFromMasterPrefs( | 103 bool InitializePrefsFromMasterPrefs( |
100 std::unique_ptr<base::DictionaryValue> master_prefs); | 104 std::unique_ptr<base::DictionaryValue> master_prefs); |
101 | 105 |
102 // Creates a single-file PrefStore as was used in M34 and earlier. Used only | 106 // Creates a single-file PrefStore as was used in M34 and earlier. Used only |
103 // for testing migration. | 107 // for testing migration. |
104 PersistentPrefStore* CreateDeprecatedCombinedProfilePrefStore( | 108 PersistentPrefStore* CreateDeprecatedCombinedProfilePrefStore( |
(...skipping 18 matching lines...) Expand all Loading... |
123 tracking_configuration_; | 127 tracking_configuration_; |
124 const size_t reporting_ids_count_; | 128 const size_t reporting_ids_count_; |
125 const std::string seed_; | 129 const std::string seed_; |
126 const std::string legacy_device_id_; | 130 const std::string legacy_device_id_; |
127 PrefService* local_state_; | 131 PrefService* local_state_; |
128 | 132 |
129 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); | 133 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); |
130 }; | 134 }; |
131 | 135 |
132 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ | 136 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ |
OLD | NEW |