network_change.mojom 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Copyright 2022 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. // This needs to match the definition of net::ConnectionType.
  6. [Stable, Extensible]
  7. enum ConnectionType {
  8. [Default] CONNECTION_UNKNOWN = 0, // A connection exists, but its type is
  9. // unknown. Also used as a default value.
  10. CONNECTION_ETHERNET = 1,
  11. CONNECTION_WIFI = 2,
  12. CONNECTION_2G = 3,
  13. CONNECTION_3G = 4,
  14. CONNECTION_4G = 5,
  15. CONNECTION_NONE = 6, // No connection.
  16. CONNECTION_BLUETOOTH = 7,
  17. CONNECTION_5G = 8,
  18. CONNECTION_LAST = CONNECTION_5G
  19. };
  20. // This needs to match the definition of net::ConnectionSubtype.
  21. [Stable, Extensible]
  22. enum ConnectionSubtype {
  23. [Default] SUBTYPE_UNKNOWN = 0,
  24. SUBTYPE_NONE,
  25. SUBTYPE_OTHER,
  26. SUBTYPE_GSM,
  27. SUBTYPE_IDEN,
  28. SUBTYPE_CDMA,
  29. SUBTYPE_1XRTT,
  30. SUBTYPE_GPRS,
  31. SUBTYPE_EDGE,
  32. SUBTYPE_UMTS,
  33. SUBTYPE_EVDO_REV_0,
  34. SUBTYPE_EVDO_REV_A,
  35. SUBTYPE_HSPA,
  36. SUBTYPE_EVDO_REV_B,
  37. SUBTYPE_HSDPA,
  38. SUBTYPE_HSUPA,
  39. SUBTYPE_EHRPD,
  40. SUBTYPE_HSPAP,
  41. SUBTYPE_LTE,
  42. SUBTYPE_LTE_ADVANCED,
  43. SUBTYPE_BLUETOOTH_1_2,
  44. SUBTYPE_BLUETOOTH_2_1,
  45. SUBTYPE_BLUETOOTH_3_0,
  46. SUBTYPE_BLUETOOTH_4_0,
  47. SUBTYPE_ETHERNET,
  48. SUBTYPE_FAST_ETHERNET,
  49. SUBTYPE_GIGABIT_ETHERNET,
  50. SUBTYPE_10_GIGABIT_ETHERNET,
  51. SUBTYPE_WIFI_B,
  52. SUBTYPE_WIFI_G,
  53. SUBTYPE_WIFI_N,
  54. SUBTYPE_WIFI_AC,
  55. SUBTYPE_WIFI_AD,
  56. SUBTYPE_LAST = SUBTYPE_WIFI_AD
  57. };
  58. // Implemented in Ash-chrome.
  59. // Next version: 1
  60. // Next method id: 1
  61. [Stable, Uuid="f1762d7c-f5cf-4580-8fad-e181dab68e4e"]
  62. interface NetworkChange {
  63. // Adds NetworkChangeObserver to NetworkChangeManagerClient in Ash.
  64. AddObserver@0(pending_remote<NetworkChangeObserver> observer);
  65. };
  66. // Implemented in Lacros-chrome.
  67. // Next version: 1
  68. // Next method id: 1
  69. [Stable, Uuid="f95d3481-103e-4507-8e83-9bb6b7515c07"]
  70. interface NetworkChangeObserver {
  71. // Notifies observer of network change.
  72. OnNetworkChanged@0(
  73. bool dns_changed,
  74. bool ip_address_changed,
  75. bool connection_type_changed,
  76. // `new_connection_type` is ignored when `connection_type_changed` is
  77. // set to false.
  78. ConnectionType new_connection_type,
  79. bool connection_subtype_changed,
  80. // `new_connection_subtype` is ignored when `connectionsub_type_changed`
  81. // is set to false.
  82. ConnectionSubtype new_connection_subtype);
  83. };