| // Copyright 2020 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 crosapi.mojom; |
| |
| import "mojo/public/mojom/base/values.mojom"; |
| |
| // Pref paths. |
| [Stable, Extensible] |
| enum PrefPath { |
| [Default] kUnknown = 0, |
| // M89: metrics::prefs::kMetricsReportingEnabled (local state). |
| kMetricsReportingEnabled = 1, |
| // M89: ash::prefs::kAccessibilitySpokenFeedbackEnabled (profile). |
| kAccessibilitySpokenFeedbackEnabled = 2, |
| // M90: ash::prefs::kDeviceSystemWideTracingEnabled (local state). |
| [MinVersion=1] kDeviceSystemWideTracingEnabled = 3, |
| // M96: prefs::kDnsOverHttpsMode (local state) |
| [MinVersion=2] kDnsOverHttpsMode = 4, |
| // M96: prefs::kDnsOverHttpsTemplates (local state) |
| [MinVersion=2] kDnsOverHttpsTemplates = 5, |
| }; |
| |
| // Interface for pref observers. Implemented by lacros-chrome. Used by |
| // ash-chrome to send pref updates. |
| [Stable, Uuid="07d804d1-3d8d-4da1-b9b9-05f8a6bfe4c4"] |
| interface PrefObserver { |
| // Called when an observed pref changes. |
| OnPrefChanged@0(mojo_base.mojom.Value value); |
| }; |
| |
| // Interface for prefs. Implemented by ash-chrome. |
| // Next version: 1 |
| // Next method id: 3 |
| [Stable, Uuid="815df607-0596-46f7-9ed9-14683b4826a3"] |
| interface Prefs { |
| // Gets the specified ash pref. Returns empty if ash-chrome does not have path |
| // registered, or if the pref is not found. |
| GetPref@0(PrefPath path) => (mojo_base.mojom.Value? value); |
| |
| // Sets the specified ash pref. Does nothing if ash-chrome does not have path |
| // registered. |
| SetPref@1(PrefPath path, mojo_base.mojom.Value value) => (); |
| |
| // Adds an observer for ash pref. The observer is fired immediately with the |
| // current value. Multiple observers may be registered for any given pref. |
| // Does nothing if ash-chrome does not have path registered. |
| AddObserver@2(PrefPath path, pending_remote<PrefObserver> observer); |
| }; |