chromium/chromecast/common/BUILD.gn

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

import("//chromecast/chromecast.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//third_party/widevine/cdm/widevine.gni")

cast_source_set("queryable_data") {
  sources = [
    "queryable_data.cc",
    "queryable_data.h",
  ]

  deps = [ "//base" ]
}

cast_source_set("resource_delegate") {
  sources = [
    "cast_resource_delegate.cc",
    "cast_resource_delegate.h",
  ]
  deps = [
    "//base",
    "//ui/base",
    "//ui/gfx",
  ]
}

cast_source_set("activity_url_filter") {
  sources = [
    "activity_filtering_url_loader_throttle.cc",
    "activity_filtering_url_loader_throttle.h",
    "activity_url_filter.cc",
    "activity_url_filter.h",
  ]

  deps = [
    "//base",
    "//components/url_matcher",
    "//services/network/public/cpp:cpp_base",
    "//third_party/blink/public/common:common",
    "//third_party/blink/public/common:headers",
    "//url",
  ]
}

cast_source_set("feature_constants") {
  sources = [
    "feature_constants.cc",
    "feature_constants.h",
  ]
}

test("cast_common_unittests") {
  testonly = true

  sources = [
    "activity_url_filter_unittest.cc",
    "cors_exempt_headers_unittest.cc",
    "user_agent_unittest.cc",
  ]

  deps = [
    ":activity_url_filter",
    ":common",
    ":cors_exempt_headers",
    "//base/test:run_all_unittests",
    "//base/test:test_support",
    "//components/version_info",
    "//testing/gmock",
    "//testing/gtest",
    "//url",
  ]
}

cast_source_set("cors_exempt_headers") {
  sources = [
    "cors_exempt_headers.cc",
    "cors_exempt_headers.h",
  ]

  deps = [ "//base" ]
}

cast_source_set("common") {
  sources = [
    "cast_content_client.cc",
    "cast_content_client.h",
    "global_descriptors.h",
    "user_agent.cc",
    "user_agent.h",
  ]

  if (is_android) {
    sources += [ "user_agent_android.cc" ]
  } else {
    sources += [ "user_agent_default.cc" ]
  }

  public_deps = [ "//base" ]

  deps = [
    "//chromecast:chromecast_buildflags",
    "//chromecast/base",
    "//chromecast/base:cast_version",
    "//chromecast/common/media",
    "//components/cast/common:constants",
    "//components/embedder_support:browser_util",
    "//content/public/common",
    "//media:media_buildflags",
    "//third_party/widevine/cdm:buildflags",
    "//ui/base",
    "//url:url",
  ]

  if (!is_fuchsia) {
    deps += [ "//components/services/heap_profiling/public/cpp" ]
  }

  if (is_android || is_fuchsia) {
    deps += [ "//components/cdm/common:common" ]
  }

  if (enable_library_cdms) {
    deps += [ "//media/cdm:cdm_paths" ]  # Needed by cast_content_client.cc
  }

  defines = [ "DEVICE_USER_AGENT_SUFFIX=\"${device_user_agent_suffix}\"" ]
}