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 #include "chrome/browser/prefs/profile_pref_store_manager.h" | 5 #include "chrome/browser/prefs/profile_pref_store_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/json/json_file_value_serializer.h" | 12 #include "base/json/json_file_value_serializer.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
16 #include "base/sequenced_task_runner.h" | 16 #include "base/sequenced_task_runner.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
19 #include "components/pref_registry/pref_registry_syncable.h" | 19 #include "components/pref_registry/pref_registry_syncable.h" |
20 #include "components/prefs/json_pref_store.h" | 20 #include "components/prefs/json_pref_store.h" |
21 #include "components/prefs/persistent_pref_store.h" | 21 #include "components/prefs/persistent_pref_store.h" |
22 #include "components/prefs/pref_registry_simple.h" | 22 #include "components/prefs/pref_registry_simple.h" |
23 #include "components/user_prefs/tracked/pref_hash_store_impl.h" | 23 #include "components/user_prefs/tracked/pref_hash_store_impl.h" |
24 #include "components/user_prefs/tracked/segregated_pref_store.h" | 24 #include "components/user_prefs/tracked/segregated_pref_store.h" |
25 #include "components/user_prefs/tracked/tracked_preferences_migration.h" | 25 #include "components/user_prefs/tracked/tracked_preferences_migration.h" |
| 26 #include "services/preferences/public/interfaces/preferences_configuration.mojom
.h" |
26 | 27 |
27 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
28 #include "chrome/install_static/install_util.h" | 29 #include "chrome/install_static/install_util.h" |
29 #include "components/user_prefs/tracked/registry_hash_store_contents_win.h" | 30 #include "components/user_prefs/tracked/registry_hash_store_contents_win.h" |
30 #endif | 31 #endif |
31 | 32 |
32 namespace { | 33 namespace { |
33 | 34 |
34 void RemoveValueSilently(const base::WeakPtr<JsonPrefStore> pref_store, | 35 void RemoveValueSilently(const base::WeakPtr<JsonPrefStore> pref_store, |
35 const std::string& key) { | 36 const std::string& key) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 std::vector<PrefHashFilter::TrackedPreferenceMetadata> | 114 std::vector<PrefHashFilter::TrackedPreferenceMetadata> |
114 unprotected_configuration; | 115 unprotected_configuration; |
115 std::vector<PrefHashFilter::TrackedPreferenceMetadata> | 116 std::vector<PrefHashFilter::TrackedPreferenceMetadata> |
116 protected_configuration; | 117 protected_configuration; |
117 std::set<std::string> protected_pref_names; | 118 std::set<std::string> protected_pref_names; |
118 std::set<std::string> unprotected_pref_names; | 119 std::set<std::string> unprotected_pref_names; |
119 for (std::vector<PrefHashFilter::TrackedPreferenceMetadata>::const_iterator | 120 for (std::vector<PrefHashFilter::TrackedPreferenceMetadata>::const_iterator |
120 it = tracking_configuration_.begin(); | 121 it = tracking_configuration_.begin(); |
121 it != tracking_configuration_.end(); | 122 it != tracking_configuration_.end(); |
122 ++it) { | 123 ++it) { |
123 if (it->enforcement_level > PrefHashFilter::NO_ENFORCEMENT) { | 124 if (it->enforcement_level > |
| 125 PrefHashFilter::EnforcementLevel::NO_ENFORCEMENT) { |
124 protected_configuration.push_back(*it); | 126 protected_configuration.push_back(*it); |
125 protected_pref_names.insert(it->name); | 127 protected_pref_names.insert(it->name); |
126 } else { | 128 } else { |
127 unprotected_configuration.push_back(*it); | 129 unprotected_configuration.push_back(*it); |
128 unprotected_pref_names.insert(it->name); | 130 unprotected_pref_names.insert(it->name); |
129 } | 131 } |
130 } | 132 } |
131 | 133 |
132 std::unique_ptr<PrefHashFilter> unprotected_pref_hash_filter( | 134 std::unique_ptr<PrefHashFilter> unprotected_pref_hash_filter( |
133 new PrefHashFilter(GetPrefHashStore(false), | 135 new PrefHashFilter(GetPrefHashStore(false), |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 ? base::MakeUnique<RegistryHashStoreContentsWin>( | 222 ? base::MakeUnique<RegistryHashStoreContentsWin>( |
221 *g_preference_validation_registry_path_for_testing, | 223 *g_preference_validation_registry_path_for_testing, |
222 profile_path_.BaseName().LossyDisplayName()) | 224 profile_path_.BaseName().LossyDisplayName()) |
223 : base::MakeUnique<RegistryHashStoreContentsWin>( | 225 : base::MakeUnique<RegistryHashStoreContentsWin>( |
224 install_static::GetRegistryPath(), | 226 install_static::GetRegistryPath(), |
225 profile_path_.BaseName().LossyDisplayName())); | 227 profile_path_.BaseName().LossyDisplayName())); |
226 #else | 228 #else |
227 return std::make_pair(nullptr, nullptr); | 229 return std::make_pair(nullptr, nullptr); |
228 #endif | 230 #endif |
229 } | 231 } |
OLD | NEW |