# Copyright 2020 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/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//ui/webui/resources/tools/build_webui.gni")

assert(is_chromeos)

build_webui("build") {
  grd_prefix = "inline_login"
  static_files = [ "inline_login.html" ]

  web_component_files = [
    "inline_login_app.ts",
    "signin_blocked_by_policy_page.ts",
    "signin_error_page.ts",
    "welcome_page_app.ts",
  ]

  ts_files = [ "inline_login_browser_proxy.ts" ]

  ts_composite = true
  ts_definitions = [
    "//chrome/browser/resources/gaia_auth_host/authenticator.d.ts",
    "//chrome/browser/resources/gaia_auth_host/saml_password_attributes.d.ts",
    "//tools/typescript/definitions/chrome_send.d.ts",
  ]
  ts_deps = [
    "//ash/webui/common/resources/cr_elements:build_ts",
    "//chrome/browser/resources/chromeos/account_manager:build_ts",
    "//chrome/browser/resources/chromeos/gaia_action_buttons:build_ts",
    "//third_party/polymer/v3_0:library",
    "//ui/webui/resources/js:build_ts",
  ]

  ts_path_mappings = [
    "chrome://chrome-signin/gaia_action_buttons/gaia_action_buttons.js|" + rebase_path(
            "${root_gen_dir}/chrome/browser/resources/chromeos/gaia_action_buttons/tsc/gaia_action_buttons.d.ts",
            target_gen_dir),
    "chrome://chrome-signin/account_manager_shared.css.js|" + rebase_path(
            "${root_gen_dir}/chrome/browser/resources/chromeos/account_manager/tsc/account_manager_shared.css.js",
            target_gen_dir),
    "chrome://chrome-signin/gaia_auth_host/*|" +
        rebase_path("//chrome/browser/resources/gaia_auth_host/*",
                    target_gen_dir),
  ]

  webui_context_type = "trusted"
}
