device_settings_service.mojom 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. module crosapi.mojom;
  5. import "mojo/public/mojom/base/values.mojom";
  6. // Optional int64 field.
  7. [Stable]
  8. struct NullableInt64 {
  9. int64 value;
  10. };
  11. // Copy of UsbDetachableAllowlistProto from chrome_device_policy.proto.
  12. [Stable]
  13. struct UsbDetachableAllowlist {
  14. array<UsbDeviceId> usb_device_ids@0;
  15. };
  16. // Copy of UsbDeviceIdInclusiveProto from chrome_device_policy.proto.
  17. [Stable]
  18. struct UsbDeviceId {
  19. // USB Vendor Identifier (aka idVendor).
  20. bool has_vendor_id@0;
  21. int32 vendor_id@1;
  22. // USB Product Identifier (aka idProduct).
  23. bool has_product_id@2;
  24. int32 product_id@3;
  25. };
  26. // All the device settings data that are needed in Lacros should be here.
  27. //
  28. // Next MinVersion: 4
  29. [Stable]
  30. struct DeviceSettings {
  31. // The value of AttestationForContentProtectionEnabled device setting.
  32. OptionalBool attestation_for_content_protection_enabled@0;
  33. // The value of DeviceSystemWideTracingEnabled device policy.
  34. OptionalBool device_system_wide_tracing_enabled@1;
  35. // The value of UsbDetachableAllowlist device policy.
  36. UsbDetachableAllowlist? usb_detachable_allow_list@2;
  37. // The value of DeviceEphemeralUsersEnabled device policy.
  38. [MinVersion=1] OptionalBool device_ephemeral_users_enabled@3;
  39. // The value of DeviceRestrictedManagedGuestSessionEnabled device policy.
  40. [MinVersion=2]
  41. OptionalBool device_restricted_managed_guest_session_enabled@4;
  42. // The value of ReportDeviceNetworkStatus device policy.
  43. [MinVersion=3]
  44. OptionalBool report_device_network_status@5;
  45. // The value of ReportDeviceUploadFrequency device policy.
  46. [MinVersion=3]
  47. NullableInt64? report_upload_frequency@6;
  48. // The value of ReportDeviceNetworkTelemetryCollectionRateMs device policy.
  49. [MinVersion=3]
  50. NullableInt64? report_device_network_telemetry_collection_rate_ms@7;
  51. [Stable]
  52. enum OptionalBool {
  53. kUnset,
  54. kFalse,
  55. kTrue,
  56. };
  57. };
  58. // Interface for device settings observers. Implemented by lacros-chrome. Used
  59. // by ash-chrome to send device settings updates.
  60. [Stable, Uuid="c2d2367e-1179-42ca-97ab-426a0c3cd265"]
  61. interface DeviceSettingsObserver {
  62. // Called when device settings have changed.
  63. UpdateDeviceSettings@0(DeviceSettings device_settings);
  64. };
  65. // This interface is implemented by Ash-Chrome.
  66. // It includes the device policy and other device settings configurable by the
  67. // user that are needed in Lacros.
  68. [Stable, Uuid="7ce66db5-5d91-4b45-b7aa-4fcfd8a53985"]
  69. interface DeviceSettingsService {
  70. // Adds an observer for device settings updates.
  71. AddDeviceSettingsObserver@0(pending_remote<DeviceSettingsObserver> observer);
  72. // Returns all the device policy from Ash for display purpose. The
  73. // `device_policy` is a dictionary containing policy data and `legend_data`
  74. // is a dictionary containing legend data - that is the data displayed at the
  75. // top of the page describing the status of device policy.
  76. [MinVersion=2]
  77. GetDevicePolicy@2() => (mojo_base.mojom.DictionaryValue device_policy,
  78. mojo_base.mojom.DictionaryValue legend_data);
  79. // Identical to the above but deprecated since it is not correctly typed.
  80. // The returned values are either dictionaries or a null value.
  81. // TODO(https://crbug.com/1340434): Remove the deprecated overload.
  82. [MinVersion=1]
  83. GetDevicePolicyDeprecated@1() => (mojo_base.mojom.Value device_policy,
  84. mojo_base.mojom.Value legend_data);
  85. // Returns the reporting sources by the device and whether the plugin_vm
  86. // data collection is enabled.
  87. // TODO(igorcov@): Investigate if it's reasonable to include the
  88. // |plugin_vm_data_collection_enabled| into the |report_sources|.
  89. [MinVersion=3]
  90. GetDeviceReportSources@3() => (mojo_base.mojom.ListValue report_sources,
  91. bool plugin_vm_data_collection_enabled);
  92. };