910e62b5创建于 1月15日历史提交
# 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.

import("//chrome/common/features.gni")
import("//pdf/features.gni")

assert(enable_extensions_core)

# APIs and features included in both normal desktop builds and the experimental
# desktop-android build.
# TODO(https://crbug.com/356905053): Continue moving more here.
schema_sources_ = [
  "activity_log_private.json",
  "bookmarks.json",
  "cookies.json",
  "context_menus.json",
  "debugger.json",
  "desktop_capture.json",
  "developer_private.idl",
  "downloads.idl",
  "downloads_internal.idl",
  "enterprise_hardware_platform.idl",
  "font_settings.json",
  "gcm.json",
  "history.json",
  "identity.idl",
  "instance_id.json",
  "notifications.idl",
  "omnibox.json",
  "page_capture.json",
  "permissions.json",
  "processes.idl",
  "reading_list.webidl",
  "search.idl",
  "scripting.idl",
  "tab_capture.idl",
  "tabs.json",
  "web_authentication_proxy.webidl",
  "web_navigation.json",

  # Despite the name, these APIs do not rely on any WebRTC-specific bits and
  # as such do not belong in a conditional.
  "webrtc_audio_private.idl",
  "webrtc_logging_private.idl",
  "webstore_private.json",
  "windows.json",
]

if (enable_service_discovery) {
  schema_sources_ += [ "mdns.idl" ]
}

# Schemas that should be used only to auto-generate the C++ types.
# In many cases, this includes schemas used to generate types used in manifest
# parsing.
uncompiled_sources_ = [
  "action.json",
  "browsing_data.json",
  "extension.json",
  "top_sites.json",
]

# Some APIs (e.g. cookies) rely on types and headers from other APIs.
types_only_schema_sources_ = []

if (enable_extensions) {
  schema_sources_ += [
    "accessibility_features.json",
    "experimental_actor.idl",
    "experimental_ai_data.idl",
    "autofill_private.idl",
    "autotest_private.idl",
    "bookmark_manager_private.json",
    "braille_display_private.idl",
    "chrome_web_view_internal.json",
    "command_line_private.json",
    "content_settings.json",
    "crash_report_private.idl",
    "enterprise_reporting_private.idl",
    "image_writer_private.idl",
    "language_settings_private.idl",
    "passwords_private.idl",
    "resources_private.idl",
    "safe_browsing_private.idl",
    "sessions.json",
    "settings_private.idl",
    "side_panel.idl",
    "system_private.json",
    "tab_groups.json",

    # Despite the name, these APIs do not rely on any WebRTC-specific bits and
    # as such do not belong in a conditional.
    "webrtc_desktop_capture_private.idl",
  ]

  if (is_chromeos) {
    schema_sources_ += [
      "accessibility_private.json",
      "accessibility_service_private.idl",
      "certificate_provider.idl",
      "certificate_provider_internal.idl",
      "document_scan.idl",
      "echo_private.json",
      "enterprise_device_attributes.idl",
      "enterprise_kiosk_input.idl",
      "enterprise_login.idl",
      "enterprise_networking_attributes.idl",
      "enterprise_platform_keys.idl",
      "enterprise_platform_keys_internal.idl",
      "enterprise_platform_keys_private.json",
      "file_manager_private.idl",
      "file_manager_private_internal.idl",
      "file_system_provider.idl",
      "file_system_provider_internal.idl",
      "image_loader_private.idl",
      "input_method_private.json",
      "login.idl",
      "login_screen_storage.idl",
      "login_screen_ui.idl",
      "login_state.idl",
      "odfs_config_private.idl",
      "platform_keys.idl",
      "platform_keys_internal.idl",
      "quick_unlock_private.idl",
      "smart_card_provider_private.idl",
      "speech_recognition_private.idl",
      "system_log.idl",
      "terminal_private.json",
      "users_private.idl",
      "vpn_provider.idl",
      "wallpaper.json",
      "wm_desks_private.idl",
    ]

    if (use_cups) {
      schema_sources_ += [
        "printing.idl",
        "printing_metrics.idl",
      ]
    }
  }

  if (is_linux || is_win || is_chromeos) {
    schema_sources_ += [ "input_ime.json" ]
  }

  if (enable_pdf) {
    schema_sources_ += [ "pdf_viewer_private.idl" ]
  }

  uncompiled_sources_ += [
    "browser_action.json",
    "idltest.idl",
    "page_action.json",
  ]

  if (is_chromeos) {
    uncompiled_sources_ += [
      "chromeos_info_private.json",
      "media_player_private.json",
    ]
  }
}

chrome_extensions_api_schema_sources = get_path_info(schema_sources_, "abspath")

chrome_extensions_types_only_schema_sources =
    get_path_info(types_only_schema_sources_, "abspath")

chrome_extensions_manifest_only_schema_sources =
    get_path_info([ "manifest_types.json" ], "abspath")

chrome_extensions_api_uncompiled_sources =
    get_path_info(uncompiled_sources_, "abspath")

chrome_extensions_api_root_namespace = "extensions::api::%(namespace)s"

chrome_extensions_api_schema_include_rules =
    "extensions/common/api:extensions::api::%(namespace)s"