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

import("//components/cdm/common/playready.gni")
import("//third_party/widevine/cdm/widevine.gni")

static_library("renderer") {
  # See //components/cdm/README.md
  visibility = [
    "//android_webview/*",
    "//chrome/*",
    "//chromecast/*",
    "//components/cdm/*",
    "//content/shell/*",
    "//fuchsia_web/*",
  ]

  sources = [
    "external_clear_key_key_system_info.cc",
    "external_clear_key_key_system_info.h",
  ]
  deps = [
    "//base",
    "//components/cdm/common:buildflags",
    "//content/public/renderer",
    "//media",
    "//media:media_buildflags",
    "//third_party/widevine/cdm:buildflags",
  ]

  if (enable_library_cdms || is_win || is_android || arkweb_enable_cdm) {
    sources += [
      "key_system_support_update.cc",
      "key_system_support_update.h",
    ]
  }

  if (is_android) {
    sources += [
      "android_key_system_info.cc",
      "android_key_system_info.h",
    ]
  }

  if (arkweb_enable_wiseplay && arkweb_enable_cdm) {
    import("//arkweb/chromium_ext/chromium_ext.gni")
    sources += arkweb_components_cdm_renderer_soureces
  }

  if (enable_widevine) {
    sources += [
      "widevine_key_system_info.cc",
      "widevine_key_system_info.h",
    ]
    deps += [ "//third_party/widevine/cdm:headers" ]
  }

  if (enable_playready) {
    sources += [
      "playready_key_system_info.cc",
      "playready_key_system_info.h",
    ]
    deps += [ "//components/cdm/common" ]
  }
}