chromium/ui/webui/BUILD.gn

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

static_library("webui") {
  sources = [
    "mojo_web_ui_controller.cc",
    "mojo_web_ui_controller.h",
    "untrusted_web_ui_controller.cc",
    "untrusted_web_ui_controller.h",
    "untrusted_web_ui_controller_factory.cc",
    "untrusted_web_ui_controller_factory.h",
    "webui_allowlist.cc",
    "webui_allowlist.h",
    "webui_allowlist_provider.cc",
    "webui_allowlist_provider.h",
  ]

  deps = [
    "//base",
    "//components/content_settings/core/browser",
    "//content/public/browser",
    "//services/service_manager/public/cpp",
  ]

  public_deps = [
    "//ui/webui/resources/js/browser_command:mojo_bindings",
    "//ui/webui/resources/js/metrics_reporter:mojo_bindings",
  ]

  if (!is_android && !is_ios) {
    public_deps += [
      "//ui/webui/resources/cr_components/color_change_listener:mojom",
      "//ui/webui/resources/cr_components/customize_color_scheme_mode:mojom",
      "//ui/webui/resources/cr_components/history_clusters:mojo_bindings",
      "//ui/webui/resources/cr_components/most_visited:mojom",
      "//ui/webui/resources/cr_components/theme_color_picker:mojom",
    ]
    sources += [
      "color_change_listener/color_change_handler.cc",
      "color_change_listener/color_change_handler.h",
    ]
  }
}

source_set("test_support") {
  testonly = true

  sources = [
    "untrusted_web_ui_browsertest_util.cc",
    "untrusted_web_ui_browsertest_util.h",
  ]

  deps = [
    ":webui",
    "//base",
    "//content/public/browser",
    "//content/test:test_support",
  ]
}