chromium/chromeos/services/network_health/public/mojom/BUILD.gn

# Copyright 2020 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//mojo/public/tools/bindings/mojom.gni")

assert(is_chromeos)

# Network interfaces are currently used only by Ash and CrOS services.
# There's on-going work in Lacros which will probably depend on these
# in the future.
if (is_chromeos_ash) {
  mojom("mojom") {
    sources = [
      "network_diagnostics.mojom",
      "network_health.mojom",
    ]

    public_deps = [
      ":types",
      "//mojo/public/mojom/base",
    ]

    webui_module_path =
        "chrome://resources/mojo/chromeos/services/network_health/public/mojom"

    # Used by ash/webui/common/resources/network_health, which is still using
    # JS + Closure.
    generate_webui_js_bindings = true
  }
}

mojom("types") {
  sources = [ "network_health_types.mojom" ]

  public_deps = [
    "//chromeos/services/network_config/public/mojom:network_types",
    "//url/mojom:url_mojom_gurl",
  ]

  # WebUI bindings only needed on ChromeOS Ash (dependency of the mojom target
  # above). Only build them on that platform since they're using deprecated JS.
  if (is_chromeos_ash) {
    webui_module_path =
        "chrome://resources/mojo/chromeos/services/network_health/public/mojom"

    # Used by ash/webui/common/resources/network_health, which is still using
    # JS + Closure.
    generate_webui_js_bindings = true
  }
}