chromium/chrome/browser/media/router/discovery/access_code/BUILD.gn

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

import("//extensions/buildflags/buildflags.gni")
import("//third_party/protobuf/proto_library.gni")

proto_library("discovery_resources_proto") {
  sources = [ "discovery_resources.proto" ]
  cc_generator_options = "lite=true:"
}

static_library("access_code_cast_feature") {
  sources = [
    "access_code_cast_constants.cc",
    "access_code_cast_constants.h",
    "access_code_cast_feature.cc",
    "access_code_cast_feature.h",
  ]
  public_deps = [ "//base" ]
  deps = [
    "//chrome/browser/media/router:media_router_feature",
    "//chrome/browser/profiles:profile",
    "//chrome/common:channel_info",
    "//components/pref_registry:pref_registry",
    "//components/prefs",
    "//components/user_prefs",
    "//components/version_info:channel",
  ]
  configs += [ "//build/config/compiler:wexit_time_destructors" ]
}

if (!is_android) {
  static_library("access_code_sink_service") {
    sources = [
      "access_code_cast_discovery_interface.cc",
      "access_code_cast_discovery_interface.h",
      "access_code_cast_pref_updater.cc",
      "access_code_cast_pref_updater.h",
      "access_code_cast_pref_updater_impl.cc",
      "access_code_cast_pref_updater_impl.h",
      "access_code_cast_sink_service.cc",
      "access_code_cast_sink_service.h",
      "access_code_cast_sink_service_factory.cc",
      "access_code_cast_sink_service_factory.h",
      "access_code_media_sink_util.cc",
      "access_code_media_sink_util.h",
    ]
    public_deps = [
      "//base",
      "//chrome/browser:browser_public_dependencies",
      "//chrome/browser/profiles:profile",
      "//components/media_router/browser",
      "//components/media_router/common",
      "//components/media_router/common/mojom:logger",
      "//components/media_router/common/mojom:media_router",
      "//components/media_router/common/providers/cast/channel:capability",
    ]
    deps = [
      ":access_code_cast_feature",
      ":discovery_resources_proto",
      "//chrome/browser/media/router:router",
      "//chrome/browser/media/router/discovery",
      "//chrome/browser/profiles:profile",
      "//chrome/browser/signin:identity_manager_provider",
      "//chrome/browser/ui/webui/access_code_cast:mojo_bindings",
      "//components/access_code_cast/common:metrics",
      "//components/endpoint_fetcher",
      "//components/keyed_service/content:content",
      "//components/leveldb_proto:leveldb_proto",
      "//components/media_router/common/providers/cast/channel",
      "//components/pref_registry",
      "//components/prefs",
      "//components/signin/public/base",
      "//components/signin/public/identity_manager",
      "//components/user_manager",
      "//content/public/browser",
      "//services/preferences/public/cpp",
    ]
    configs += [ "//build/config/compiler:wexit_time_destructors" ]

    if (is_chromeos_lacros) {
      sources += [
        "access_code_cast_pref_updater_lacros.cc",
        "access_code_cast_pref_updater_lacros.h",
      ]
      deps += [
        "//chromeos/crosapi/mojom",
        "//chromeos/lacros",
      ]
    }
  }
}