chromium/ios/web/common/BUILD.gn

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

import("//ios/build/config.gni")

source_set("common") {
  sources = [
    "annotations_utils.h",
    "annotations_utils.mm",
    "crw_content_view.h",
    "crw_input_view_provider.h",
    "crw_viewport_adjustment.h",
    "crw_viewport_adjustment_container.h",
    "crw_web_view_content_view.h",
    "crw_web_view_content_view.mm",
    "referrer_util.cc",
    "referrer_util.h",
    "url_scheme_util.h",
    "url_scheme_util.mm",
    "url_util.cc",
    "url_util.h",
  ]

  deps = [
    "//base",
    "//ios/third_party/webkit",
    "//ios/web/public/navigation",
    "//net",
    "//services/network/public/cpp",
    "//url",
  ]

  public_deps = [ ":features" ]

  frameworks = [ "UIKit.framework" ]
}

source_set("features") {
  deps = [
    "//base",
    "//build:blink_buildflags",
  ]
  sources = [
    "features.h",
    "features.mm",
  ]
}

source_set("uikit") {
  sources = [
    "uikit_ui_util.h",
    "uikit_ui_util.mm",
  ]

  deps = [ "//base" ]
}

source_set("web_view_creation_util") {
  sources = [
    "web_view_creation_util.h",
    "web_view_creation_util.mm",
  ]

  deps = [
    ":user_agent",
    "//base",
    "//ios/web/web_state:web_view_internal_creation_util",
    "//ios/web/web_state/ui:wk_web_view_configuration_provider",
  ]

  frameworks = [ "UIKit.framework" ]
}

# This is a separate target as it is used by Cronet.
source_set("user_agent") {
  deps = [
    ":features",
    "//base",
  ]

  sources = [
    "user_agent.h",
    "user_agent.mm",
  ]
}

source_set("unittests") {
  testonly = true
  deps = [
    ":common",
    ":user_agent",
    "//base",
    "//base/test:test_support",
    "//ios/web/public/navigation",
    "//net",
    "//testing/gtest",
    "//third_party/ocmock",
    "//ui/base",
    "//url",
  ]

  sources = [
    "referrer_util_unittest.cc",
    "url_scheme_util_unittest.mm",
    "url_util_unittest.cc",
    "user_agent_unittest.mm",
  ]
}