Chromium Code Reviews| Index: services/preferences/public/interfaces/preferences.mojom |
| diff --git a/services/preferences/public/interfaces/preferences.mojom b/services/preferences/public/interfaces/preferences.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..91546ea35c98dc6946e62da918758fd7731a892c |
| --- /dev/null |
| +++ b/services/preferences/public/interfaces/preferences.mojom |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +module prefs.mojom; |
| + |
| +// A Preference could be one of several base types. PrefStore utilizes |
| +// base::Value to encompass these. TODO(jonross): create struct traits so that |
| +// we can pass base::Value via mojo. |
|
Ben Goodger (Google)
2016/09/08 17:40:08
FYI, Ken tells me there's already param traits sup
jonross
2016/09/09 15:55:35
Yeah there are apparently some of the base::Value
|
| +struct Preference { |
| + enum PreferenceType { INT, STRING }; |
| + |
| + PreferenceType type; |
| + uint32 integer_value_; |
| + string? string_value_; |
| +}; |
| + |
| +// Used to subscribe to preference changes within PreferenceManager. After |
| +// requesting to observe, the current values for all requested keys are sent. |
| +interface PreferenceObserver { |
| + OnPreferencesChanged(map<string, Preference> preferences); |
| +}; |
| + |
| +// Manages actual read/write of preference data. Accepts observers who subscribe |
| +// to preferences, notifying them of changes. |
| +interface PreferenceManager { |
| + AddObserver(array<string> preferences, PreferenceObserver client); |
| + SetPreferences(map<string, Preference> preferences); |
| +}; |