Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: services/preferences/public/interfaces/preferences.mojom

Issue 2856083002: Pref service: support for incognito prefs (Closed)
Patch Set: Fix compilation on Windows Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 module prefs.mojom; 5 module prefs.mojom;
6 6
7 import "mojo/common/file_path.mojom";
8 import "mojo/common/string16.mojom";
7 import "mojo/common/values.mojom"; 9 import "mojo/common/values.mojom";
8 import "services/preferences/public/interfaces/preferences_configuration.mojom"; 10 import "services/preferences/public/interfaces/tracked_preference_validation_del egate.mojom";
9 11
10 const string kServiceName = "preferences"; 12 const string kServiceName = "preferences";
11 const string kForwarderServiceName = "preferences_forwarder"; 13 const string kForwarderServiceName = "preferences_forwarder";
12 14
13 // The know pref store types. 15 // The know pref store types.
14 // 16 //
15 // Should be kept in sync with PrefValueStore::PrefStoreType. 17 // Should be kept in sync with PrefValueStore::PrefStoreType.
16 enum PrefStoreType { 18 enum PrefStoreType {
17 MANAGED, 19 MANAGED,
18 SUPERVISED_USER, 20 SUPERVISED_USER,
19 EXTENSION, 21 EXTENSION,
20 COMMAND_LINE, 22 COMMAND_LINE,
23 INCOGNITO,
Sam McNally 2017/05/10 01:22:16 Below USER.
Bernhard Bauer 2017/05/11 14:34:33 I thought the idea was that this would be the stor
tibell 2017/05/11 22:44:42 I should probably name this enum value better (UND
Bernhard Bauer 2017/05/12 09:44:30 Right, what I meant was: assuming that the change
21 USER, 24 USER,
22 RECOMMENDED, 25 RECOMMENDED,
23 DEFAULT, 26 DEFAULT,
24 }; 27 };
25 28
26 // Allows observing changes to prefs stored in a |PrefStore|. 29 // Allows observing changes to prefs stored in a |PrefStore|.
27 interface PrefStoreObserver { 30 interface PrefStoreObserver {
28 // Preferences have been changed. 31 // Preferences have been changed.
29 OnPrefsChanged(array<PrefUpdate> updates); 32 OnPrefsChanged(array<PrefUpdate> updates);
30 33
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Connect to all registered pref stores, retrieving the current values of all 93 // Connect to all registered pref stores, retrieving the current values of all
91 // prefs in each store and an |observer| interfaces through which updates can 94 // prefs in each store and an |observer| interfaces through which updates can
92 // be received. The client asserts that it is already connected to the 95 // be received. The client asserts that it is already connected to the
93 // |already_connected_types| pref stores through some other means, so the 96 // |already_connected_types| pref stores through some other means, so the
94 // Connect call will not connect to those. 97 // Connect call will not connect to those.
95 [Sync] 98 [Sync]
96 Connect(PrefRegistry pref_registry, 99 Connect(PrefRegistry pref_registry,
97 array<PrefStoreType> already_connected_types) => 100 array<PrefStoreType> already_connected_types) =>
98 (PersistentPrefStoreConnection connection, 101 (PersistentPrefStoreConnection connection,
99 map<PrefStoreType, PrefStoreConnection> connections); 102 map<PrefStoreType, PrefStoreConnection> connections);
103
104 // Connect to a read-only view of the user pref store. Used for incognito.
105 ConnectToUserPrefStore(PrefStore& request);
100 }; 106 };
101 107
102 // An update to a subcomponent of a pref. 108 // An update to a subcomponent of a pref.
103 struct SubPrefUpdate { 109 struct SubPrefUpdate {
104 // The path to the changed value within the pref. 110 // The path to the changed value within the pref.
105 array<string> path; 111 array<string> path;
106 // The new value; a null |value| indicates a delete. 112 // The new value; a null |value| indicates a delete.
107 mojo.common.mojom.Value? value; 113 mojo.common.mojom.Value? value;
108 }; 114 };
109 115
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // PrefRegistry::PrefRegistrationFlags and 154 // PrefRegistry::PrefRegistrationFlags and
149 // PrefRegistrySyncable::PrefRegistrationFlags. 155 // PrefRegistrySyncable::PrefRegistrationFlags.
150 uint32 flags; 156 uint32 flags;
151 }; 157 };
152 158
153 interface PrefServiceControl { 159 interface PrefServiceControl {
154 // Initializes the pref service. This must be called before the service can 160 // Initializes the pref service. This must be called before the service can
155 // be used. 161 // be used.
156 Init(PersistentPrefStoreConfiguration configuration); 162 Init(PersistentPrefStoreConfiguration configuration);
157 }; 163 };
164
165 // ---------------------------------------------------------------------
166 // Service Configuration
167
168 union PersistentPrefStoreConfiguration {
169 SimplePersistentPrefStoreConfiguration simple_configuration;
170 TrackedPersistentPrefStoreConfiguration tracked_configuration;
171 IncognitoPersistentPrefStoreConfiguration incognito_configuration;
172 };
173
174 struct SimplePersistentPrefStoreConfiguration {
175 mojo.common.mojom.FilePath pref_filename;
176 };
177
178 // These parameters are passed to prefs::CreateTrackedPersistentPrefStore() in
179 // services/preferences/persistent_pref_store_factory.cc.
180 struct TrackedPersistentPrefStoreConfiguration {
181 mojo.common.mojom.FilePath unprotected_pref_filename;
182 mojo.common.mojom.FilePath protected_pref_filename;
183 array<TrackedPreferenceMetadata> tracking_configuration;
184 uint64 reporting_ids_count;
185 string seed;
186 string legacy_device_id;
187 string registry_seed;
188 mojo.common.mojom.String16 registry_path;
189 TrackedPreferenceValidationDelegate? validation_delegate;
190 ResetOnLoadObserver? reset_on_load_observer;
191 };
192
193 struct TrackedPreferenceMetadata {
194 enum EnforcementLevel { NO_ENFORCEMENT, ENFORCE_ON_LOAD };
195
196 enum PrefTrackingStrategy {
197 // Atomic preferences are tracked as a whole.
198 ATOMIC,
199 // Split preferences are dictionaries for which each top-level entry is
200 // tracked independently. Note: preferences using this strategy must be kept
201 // in sync with TrackedSplitPreferences in histograms.xml.
202 SPLIT,
203 };
204
205 enum ValueType {
206 IMPERSONAL,
207 // The preference value may contain personal information.
208 PERSONAL,
209 };
210
211 uint64 reporting_id;
212 string name;
213 EnforcementLevel enforcement_level;
214 PrefTrackingStrategy strategy;
215 ValueType value_type;
216 };
217
218 interface ResetOnLoadObserver {
219 OnResetOnLoad();
220 };
221
222 struct IncognitoPersistentPrefStoreConfiguration {
223 // A connector for the underlying user's prefs. Used to serve that user's
224 // prefs in a read-only fashion.
225 PrefStoreConnector connector;
226 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698