OLD | NEW |
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/values.mojom"; | 7 import "mojo/common/values.mojom"; |
8 import "services/preferences/public/interfaces/preferences_configuration.mojom"; | 8 import "services/preferences/public/interfaces/preferences_configuration.mojom"; |
9 | 9 |
10 const string kServiceName = "preferences"; | 10 const string kServiceName = "preferences"; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 PrefStoreConnection? pref_store_connection; | 87 PrefStoreConnection? pref_store_connection; |
88 PersistentPrefStore? pref_store; | 88 PersistentPrefStore? pref_store; |
89 ReadError read_error; | 89 ReadError read_error; |
90 bool read_only; | 90 bool read_only; |
91 }; | 91 }; |
92 | 92 |
93 // Manages actual read of preference data. Accepts observers who subscribe to | 93 // Manages actual read of preference data. Accepts observers who subscribe to |
94 // preferences, notifying them of changes. | 94 // preferences, notifying them of changes. |
95 interface PrefStore { | 95 interface PrefStore { |
96 // Add an observer of changes. This current values of all prefs will not be | 96 // Add an observer of changes to prefs contained in |prefs_to_observe|. This |
97 // communicated through a call to |observer| but instead be returned in | 97 // current values of all prefs will not be communicated through a call to |
98 // |initial_prefs|. | 98 // |observer| but instead be returned in |initial_prefs|. |
99 AddObserver() => (PrefStoreConnection connection); | 99 AddObserver(array<string> prefs_to_observe) => ( |
| 100 PrefStoreConnection connection); |
100 }; | 101 }; |
101 | 102 |
102 // Manages a registry of all pref stores. Registered pref stores can be | 103 // Manages a registry of all pref stores. Registered pref stores can be |
103 // connected to through the |PrefStoreConnector| interface. | 104 // connected to through the |PrefStoreConnector| interface. |
104 interface PrefStoreRegistry { | 105 interface PrefStoreRegistry { |
105 // Register a pref store. | 106 // Register a pref store. |
106 Register(PrefStoreType type, PrefStore pref_store); | 107 Register(PrefStoreType type, PrefStore pref_store); |
107 }; | 108 }; |
108 | 109 |
109 // Allows connections to pref stores registered with |PrefStoreRegistry|. | 110 // Allows connections to pref stores registered with |PrefStoreRegistry|. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // PrefRegistry::PrefRegistrationFlags and | 142 // PrefRegistry::PrefRegistrationFlags and |
142 // PrefRegistrySyncable::PrefRegistrationFlags. | 143 // PrefRegistrySyncable::PrefRegistrationFlags. |
143 uint32 flags; | 144 uint32 flags; |
144 }; | 145 }; |
145 | 146 |
146 interface PrefServiceControl { | 147 interface PrefServiceControl { |
147 // Initializes the pref service. This must be called before the service can | 148 // Initializes the pref service. This must be called before the service can |
148 // be used. | 149 // be used. |
149 Init(PersistentPrefStoreConfiguration configuration); | 150 Init(PersistentPrefStoreConfiguration configuration); |
150 }; | 151 }; |
OLD | NEW |