chromium/chrome/browser/resources/extensions/BUILD.gn

# 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("//build/config/chromeos/ui_mode.gni")
import("//extensions/buildflags/buildflags.gni")
import("//ui/webui/resources/tools/build_webui.gni")

assert(enable_extensions, "enable extensions check failed")

build_webui("build") {
  grd_prefix = "extensions"

  static_files = [ "extensions.html" ]

  # Files holding a Polymer element definition and have an equivalent .html file.
  web_component_files = [
    "activity_log/activity_log.ts",
    "activity_log/activity_log_history.ts",
    "activity_log/activity_log_history_item.ts",
    "activity_log/activity_log_stream.ts",
    "activity_log/activity_log_stream_item.ts",
    "code_section.ts",
    "detail_view.ts",
    "drop_overlay.ts",
    "error_page.ts",
    "host_permissions_toggle_list.ts",
    "install_warnings_dialog.ts",
    "item.ts",
    "item_list.ts",
    "keyboard_shortcuts.ts",
    "load_error.ts",
    "manager.ts",
    "mv2_deprecation_panel.ts",
    "options_dialog.ts",
    "pack_dialog.ts",
    "pack_dialog_alert.ts",
    "restricted_sites_dialog.ts",
    "review_panel.ts",
    "runtime_host_permissions.ts",
    "runtime_hosts_dialog.ts",
    "shortcut_input.ts",
    "sidebar.ts",
    "site_permissions/site_permissions_by_site.ts",
    "site_permissions/site_permissions_edit_permissions_dialog.ts",
    "site_permissions/site_permissions_edit_url_dialog.ts",
    "site_permissions/site_permissions_list.ts",
    "site_permissions/site_permissions_site_group.ts",
    "site_permissions/site_permissions.ts",
    "toggle_row.ts",
    "toolbar.ts",
  ]

  non_web_component_files = [
    "drag_and_drop_handler.ts",
    "extensions.ts",
    "item_mixin.ts",
    "item_util.ts",
    "mv2_deprecation_delegate.ts",
    "mv2_deprecation_util.ts",
    "keyboard_shortcut_delegate.ts",
    "navigation_helper.ts",
    "service.ts",
    "shortcut_util.ts",
    "site_permissions/site_settings_mixin.ts",
    "url_util.ts",
  ]

  icons_html_files = [ "icons.html" ]

  # Files that are passed as input to css_to_wrapper().
  css_files = [
    "shared_style.css",
    "shared_vars.css",
  ]

  ts_composite = true
  ts_definitions = [
    "//tools/typescript/definitions/activity_log_private.d.ts",
    "//tools/typescript/definitions/chrome_event.d.ts",
    "//tools/typescript/definitions/developer_private.d.ts",
    "//tools/typescript/definitions/management.d.ts",
    "//tools/typescript/definitions/metrics_private.d.ts",
    "//tools/typescript/definitions/pending.d.ts",
    "//tools/typescript/definitions/runtime.d.ts",
    "//tools/typescript/definitions/tabs.d.ts",
    "//tools/typescript/definitions/chrome_send.d.ts",
  ]

  ts_deps = [
    "//third_party/polymer/v3_0:library",
    "//ui/webui/resources/cr_components/managed_footnote:build_ts",
    "//ui/webui/resources/cr_elements:build_ts",
    "//ui/webui/resources/js:build_ts",
  ]

  webui_context_type = "trusted"
  optimize = optimize_webui
  if (optimize) {
    optimize_webui_host = "extensions"
    optimize_webui_in_files = [ "extensions.js" ]
  }
}